symkat/Daemon-Control — pull request #53 by atomicstack (2013-08-21 13:36:35+00:00)
Title: Abort the kill loop in do_stop if $self->pid changes midway.

If we're running in a high-availability situation, this prevents
do_stop from terminating the standby worker, in addition to the currently
exiting active worker, from getting taken out by the kill loop
after it has promoted itself to the active worker as a result of
running `$main_worker stop`. We do this by caching the PID we first
encounter, and aborting the kill loop immediately if we see it change
while we're inside the kill loop.