} \
} while (0)
+#define CLEAR_ALARM \
+ do { \
+ pool_debug("health check: clearing alarm"); \
+ } while (alarm(0) > 0)
#define PGPOOLMAXLITSENQUEUELENGTH 10000
static void daemonize(void);
* communication path failure much earlier before
* TCP/IP stack detects it.
*/
+ CLEAR_ALARM;
pool_signal(SIGALRM, health_check_timer_handler);
alarm(pool_config->health_check_timeout);
}
retrycnt++;
pool_signal(SIGALRM, SIG_IGN); /* Cancel timer */
+ CLEAR_ALARM;
if (!pool_config->parallel_mode)
{
{
sys_retrycnt++;
pool_signal(SIGALRM, SIG_IGN);
+ CLEAR_ALARM;
if (sys_retrycnt > NUM_BACKENDS)
{
{
/* seems OK. cancel health check timer */
pool_signal(SIGALRM, SIG_IGN);
+ CLEAR_ALARM;
}
sleep_time = pool_config->health_check_period;
/* call PCP child main */
POOL_SETMASK(&UnBlockSig);
+ health_check_timer_expired = 0;
reload_config_request = 0;
run_as_pcp_child = true;
pcp_do_child(unix_fd, inet_fd, pcp_conf_file);
/* call child main */
POOL_SETMASK(&UnBlockSig);
+ health_check_timer_expired = 0;
reload_config_request = 0;
my_proc_id = id;
run_as_pcp_child = false;
/* call child main */
POOL_SETMASK(&UnBlockSig);
+ health_check_timer_expired = 0;
reload_config_request = 0;
do_worker_child();
}