Track all child process so we never send a signal to an unrelated process (our child...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 3 May 2012 01:42:41 +0000 (11:42 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 3 May 2012 04:03:26 +0000 (14:03 +1000)
commitf73a4b1495830bcdd094a93732a89dd53b3c2f78
treeb188d450a5062ed963ccca5edfe87e2aa01c663e
parent90e8c4dc7d89c460ad2da5a9af1cef006db3b1c0
Track all child process so we never send a signal to an unrelated process (our child died  and kernel wrapped the pid-space and reused the pid for a different process

Wrap all creation of child processes inside ctdb_fork() which is used to track all processes we have spawned.
Capture SIGCHLD to track also which child processes have terminated.

Wrap kill() inside ctdb_kill() and make sure that we never send a !0 signal to a child process pid that has already terminated (and might have been replaced with a
17 files changed:
Makefile.in
common/ctdb_fork.c [new file with mode: 0644]
common/ctdb_util.c
include/ctdb_private.h
server/ctdb_call.c
server/ctdb_daemon.c
server/ctdb_freeze.c
server/ctdb_lockwait.c
server/ctdb_recover.c
server/ctdb_recoverd.c
server/ctdb_takeover.c
server/ctdb_traverse.c
server/ctdb_update_record.c
server/ctdb_vacuum.c
server/eventscript.c
tests/src/ctdb_test.c
tests/src/ctdbd_test.c