SIGTERM graceful shutdown
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenSRF |
New
|
Undecided
|
Unassigned |
Bug Description
In OpenSRF today, receiving a TERM signal causes the listener process to immediately kill all child processes, regardless of whether they are servicing requests. The TERM signal should be handled more gracefully, though. Child processes should be given a chance to complete their currently running task and cleanly shut down.
My proposed signal handling:
TERM -- de-register router, followed by graceful child process cleanup
QUIT/INT - de-register router, immediately kill children
KILL - standard, non-graceful, everything dies now. (We have no control over this).
-----
Here is a patch to implement this in Perl : working/
A similar patch for C is in progress.
Code for C pushed to working/ user/berick/ lp1203791- sigterm- shutdown- in-c
This code relies on parts of the C code from bug #1193473, specifically the router un-register logic. Bug #1193473 should be considered a prereq for this bug (or we need to refactor some C code to split them out).