spotify/luigi — pull request #399 by danielhfrank (2014-08-08 22:14:27+00:00)
Title: Gracefully close worker on term.

This change (attempts to) add a signal handler to the worker allowing it
to gracefully shutdown on a TERM signal. This means that it will finish
the tasks that it has accepted but not request any more work.

This change is a little less straightforward than my earlier one; we'll be kicking the tires on it over the coming days. Is it clear what the motivation is for this feature? Was I right in trying to get the worker to not call _get_work when it is in the process of shutting down? Would you prefer that the signal the worker listens for be somehow configurable? Thanks for looking!