]> git.ipfire.org Git - thirdparty/squid.git/commit - src/ipc/Kid.h
If a worker process crashes during shutdown, dump core and prevent restarts.
authorDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Wed, 30 Mar 2011 19:39:14 +0000 (13:39 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 30 Mar 2011 19:39:14 +0000 (13:39 -0600)
commitca4b9ee6b684afffb9c4d96b28a166627eee7722
tree7730b3ff3aa8e4d145b4df010dcaf1fe77cff96f
parent8b997339d1616c06ff2a3b5236310e20a1b0b3a7
If a worker process crashes during shutdown, dump core and prevent restarts.

Before the change, if a worker process crashes during shutdown, death()
handler would exit with code 1, and master process would restart the
worker. Now workers send SIGUSR1 to master when shutting down. When
master process gets the SIGUSR1 signal, it stops restarting workers.

SIGUSR1 is already used for log rotation, but it is fine to use SIGUSR1
for master process shutdown notifications because master is never
responsible for both log rotation and kid restarts.

Terminate with abort(3) instead of exit(3) to leave a core dump if Squid
worker crashes during shutdown.

Also the patch fixes potential infinite loop in master process. Master
used to finish only when all kids exited with success, or all kids are
hopeless, or all kids were killed by a signal, but when some kids are
hopeless and others were killed, the master process would not exit.
After the change, master exits when there are no running kids and no
kids should be restarted.

Add syslog notice if kid becomes hopeless.
src/ipc/Kid.cc
src/ipc/Kid.h
src/ipc/Kids.cc
src/ipc/Kids.h
src/main.cc
src/protos.h
src/tools.cc