Content-Length: 286810 | pFad | http://github.com/postgrespro/postgres_cluster/commit/04bbd42d0f0b33216e146b50fd33fd744659143f

55 Fix debug messages during arbiter assassination. · postgrespro/postgres_cluster@04bbd42 · GitHub
Skip to content

Commit 04bbd42

Browse files
kvapkelvich
authored andcommitted
Fix debug messages during arbiter assassination.
1 parent b6e3738 commit 04bbd42

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

contrib/arbiter/src/main.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,8 @@ void kill_the_elder(char *datadir) {
807807
free(pidpath);
808808

809809
if (pid > 1) {
810-
if (kill(pid, SIGTERM)) {
810+
int rc = kill(pid, SIGTERM);
811+
if (rc) {
811812
switch(errno) {
812813
case EPERM:
813814
shout("was not allowed to kill pid=%d\n", pid);
@@ -816,11 +817,12 @@ void kill_the_elder(char *datadir) {
816817
shout("pid=%d not found for killing\n", pid);
817818
break;
818819
}
820+
} else {
821+
debug("SIGTERM sent to pid=%d\n", pid);
822+
debug("waiting for pid=%d to die\n", pid);
823+
waitpid(pid, NULL, 0);
824+
debug("pid=%d died\n", pid);
819825
}
820-
debug("SIGTERM sent to pid=%d\n", pid);
821-
debug("waiting for pid=%d to die\n", pid);
822-
waitpid(pid, NULL, 0);
823-
debug("pid=%d died\n", pid);
824826
} else {
825827
debug("no elder to kill\n");
826828
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/04bbd42d0f0b33216e146b50fd33fd744659143f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy