Add a graceful restart to command taskd, so that new code can take effect for new tasks, but existing long-running tasks can keep running.
- send the command - a separate paster command that sends a OS signal? need to make sure it goes to the right proc when multiple taskd processes are being used
- taskd receives the orders and should continue its current task but then stop when done with it
- when done, it should restart itself, e.g. http://www.daniweb.com/software-development/python/code/260268/restart-your-python-program
- add appropriate logging at every step, so it is clear what happens
As reference,
apachectl
uses signals USR1 for graceful and HUP for restart. http://httpd.apache.org/docs/2.2/stopping.html#gracefulallura:db/4914
For easier testing on our sandboxes:
Test:
Here's an example of a task good for testing
Create a lot of them with:
Then you can change the logging within the event, and do a graceful restart to confirm that the new code is used.