stulentsev/resque-multi-job-forks — pull request #3 by jonhyman (2013-03-25 16:10:16+00:00)
Title: Adds intraprocess communication so when the parent is sent a QUIT or a U...

...SR2 that it shuts down the child process.

---

With Resque's new signal processing, the child fork unregisters QUIT. As such, the problem is that you can't gracefully shutdown a child fork that hasn't reached its job limit. If you QUIT the parent, the child has to outlive its JOBS_PER_FORK limit before it'll stop. If you were to try to QUIT the child, it would term because of the new signal handling introduced in 1.23.0 when TERM_CHILD=1.

As a workaround, this adds communication between the parent and the child; when the parent receives a USR2 or a CONT, it'll shutdown the child via a different signal.