From f035ebfafad776417b55d20c3ec2ec68b69d9f87 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Mon, 26 Jun 2006 08:25:17 +0000 Subject: [PATCH] Fix segfault problem in race conditions among connection_life_time, child_life_time and child_max_connections. --- ChangeLog | 6 +++++- child.c | 14 ++++++++++++++ pool_connection_pool.c | 11 +++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 77a9e94..0ded319 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,7 +10,11 @@ query when PANIC or FATAL error occurs. In this case the backend closes the communication channel immediately which will cause unwanted failover/degeneration (Tatsuo) - + * Fix dealock problem in extended modd by calling synchronize() in + Execute if replication_strict is enabled (Yoshiyuki) + * Fix segfault problem in race conditions among + connection_life_time, child_life_time and child_max_connections (Tatsuo) + 2006-05-17 * Version 3.0.2 * pgpool does not exit even if pgpool.conf contents is wrong(Tatsuo) diff --git a/child.c b/child.c index 3fcab64..8b4952d 100644 --- a/child.c +++ b/child.c @@ -963,11 +963,23 @@ static RETSIGTYPE close_idle_connection(int sig) } } +/* + * send frontend exiting messages to all connections. + * this is called when child life time expires or child max connections expires. + */ static void send_frontend_exits(void) { int i; POOL_CONNECTION_POOL *p = pool_connection_pool; +#ifdef HAVE_SIGPROCMASK + sigset_t oldmask; +#else + int oldmask; +#endif + + POOL_SETMASK2(&BlockSig, &oldmask); + for (i=0;iclosetime = 0; + POOL_SETMASK(&oldmask); return p; } p++; } + + POOL_SETMASK(&oldmask); return NULL; } -- 2.39.5