pgpool2.git / summary / log / commit / refs
commit f4033192657b3cbbdc45c8b7459b1c5439f69c84
Author: Yoshiyuki Asaba <y-asaba at pgfoundry.org>
Date: Wed Mar 12 05:06:37 2008 +0000
health_check_timeout did not work correctly.
Report and patch by Kenichi Sawada.
main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
index 359ec9b1c..7e6bc3f5a 100644
--- a/main.c
+++ b/main.c
@@ -143,7 +143,7 @@ long int weight_master; /* normalized weight of master (0-RAND_MAX range) */
static int stop_sig = SIGTERM; /* stopping signal default value */
-static int health_check_timer_expired; /* non 0 if health check timer expired */
+static volatile sig_atomic_t health_check_timer_expired; /* non 0 if health check timer expired */
POOL_REQUEST_INFO *Req_info; /* request info area in shared memory */
volatile sig_atomic_t *InRecovery; /* non 0 if recovery is started */
@@ -488,7 +488,7 @@ int main(int argc, char **argv)
/*
* set health checker timeout. we want to detect
* commnuication path failure much earlier before
- * TCP/IP statck detects it.
+ * TCP/IP stack detects it.
*/
pool_signal(SIGALRM, health_check_timer_handler);
alarm(pool_config->health_check_timeout);
@@ -499,7 +499,9 @@ int main(int argc, char **argv)
*/
errno = 0;
health_check_timer_expired = 0;
+ POOL_SETMASK(&UnBlockSig);
sts = health_check();
+ POOL_SETMASK(&BlockSig);
if (pool_config->parallel_mode || pool_config->enable_query_cache)
sys_sts = system_db_health_check();
[parent: 34ec097c3f2a]