binarydud/pyres — pull request #107 by cezarsa (2012-05-05 23:09:07+00:00)
Title: Handling crashes and unexpected exits in the child process

Hey guys, this pull request solves issues that happen when something unexpected occurs in the child process running the job.

Situations like a sudden SIGSEGV in the child process, or someone sending a SIGKILL to it, or a job that calls sys.exit or os._exit for some reason.

I've tried to add test cases to each situation before working on the fix to show what I mean by issues. What usually happened was the worker not noticing that the child process failed. The worker would start to wait for new messages while there was still a "resque:worker:" key on Redis associating that worker with a lost job.

The only commit that introduces changes to the way pyres works is the last one (56d9c085), so it should be easy to run the tests before and after the fixes.

You're welcome to suggest any changes. Thanks for the awesome work!