pgpool2.git / summary / log / commit / refs
commit abe14703baa18c88063fa20189863fba26fe9fb4
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Mon Aug 20 02:36:00 2012 +0000
Fix too aggressively kill other processes when pgpool shuts down.
watchdog process calls kill(0,SIG) to kill all processes related to
watchdog. Unfortunately this will kill not only watchdog related
processes but parent pgpool and even httpd in case when pgpool was
invoked from pgpoolAdmin because they are in the same process
group. So for now, fix is removing call to the kill() and setpgid()
because setpgid() does nothing useful.
In the future, we should call setsid() to establish new process group
in any case, I think.
watchdog/watchdog.c | 3 ---
watchdog/wd_child.c | 3 ---
2 files changed, 6 deletions(-)
diff --git a/watchdog/watchdog.c b/watchdog/watchdog.c
index 1afd70395..b070f8fa3 100644
--- a/watchdog/watchdog.c
+++ b/watchdog/watchdog.c
@@ -76,8 +76,6 @@ wd_exit(int exit_signo)
wd_notice_server_down();
kill (child_pid, exit_signo);
- kill (0, exit_signo);
-
child_wait(0);
exit(0);
@@ -155,7 +153,6 @@ wd_main(int fork_wait_time)
signal(SIGQUIT, wd_exit);
signal(SIGTERM, wd_exit);
signal(SIGPIPE, SIG_IGN);
- setpgid(0,pgid);
set_ps_display("lifecheck",false);
/* wait until ready to go */
diff --git a/watchdog/wd_child.c b/watchdog/wd_child.c
index 96c43f9cd..e6a148653 100644
--- a/watchdog/wd_child.c
+++ b/watchdog/wd_child.c
@@ -44,10 +44,8 @@ wd_child(int fork_wait_time)
int sock;
int fd;
int rtn;
- pid_t pgid = 0;
pid_t pid = 0;
- pgid = getpgid(0);
pid = fork();
if (pid != 0)
{
@@ -70,7 +68,6 @@ wd_child(int fork_wait_time)
signal(SIGUSR2, SIG_IGN);
signal(SIGPIPE, SIG_IGN);
signal(SIGALRM, SIG_IGN);
- setpgid(0,pgid);
init_ps_display("", "", "", "");
[parent: 6ab169f3e34b]