Fix hung up while repeating pcp_attach_node and pcp_detatch_node reported in bug track #32 etc. When node status is changed by pcp_attach_node and pcp_detatch_node, failover() sends SIGUSR1 to pcp_child process expecting it exits to refresh node status. In this situation lots of pgpool children exit and produce SIGCHLD as well. The SIGCHLD handler reaper() tries catch all SIGCHLD but sometimes it fails depending on the system load and timing. If SIGCHLD produced by pcp child is not caught, the process becomes zombie and never restarted.  The fix is, in failover() after sending SOGUSR1 to pcp child, issue waitpid() to catch the pcp child exit event and restart new pcp child process.
Fix hung up while repeating pcp_attach_node and pcp_detatch_node
reported in bug track #32 etc. When node status is changed by
pcp_attach_node and pcp_detatch_node, failover() sends SIGUSR1 to
pcp_child process expecting it exits to refresh node status. In this
situation lots of pgpool children exit and produce SIGCHLD as
well. The SIGCHLD handler reaper() tries catch all SIGCHLD but
sometimes it fails depending on the system load and timing. If SIGCHLD
produced by pcp child is not caught, the process becomes zombie and
never restarted.  The fix is, in failover() after sending SOGUSR1 to
pcp child, issue waitpid() to catch the pcp child exit event and
restart new pcp child process.

treasure-data/prestogres,treasure-data/prestogres,treasure-data/prestogres,treasure-data/prestogres,treasure-data/prestogres,treasure-data/prestogres,treasure-data/prestogres