Support for graceful reload of mule processes.

- On reload master now signals mule with HUP instead of KILL.
- Added optional call to PyOS_AfterFork to enable cpython child
  processes to override and trap HUP signal.
- Copied cursed_at/no_mercy_at pattern used with worker processes.
- Added mule_reload_mercy option.
This commit is contained in:
Paul Egan
2014-04-26 14:12:48 +01:00
parent a559361a30
commit 72c31dab7a
9 changed files with 63 additions and 10 deletions
+7
View File
@@ -168,6 +168,8 @@ struct uwsgi_option uwsgi_python_options[] = {
{"py-sharedarea", required_argument, 0, "create a sharedarea from a python bytearray object of the specified size", uwsgi_opt_add_string_list, &up.sharedarea, 0},
#endif
{"py-call-osafterfork", no_argument, 0, "enable child processes running cpython to trap OS signals", uwsgi_opt_true, &up.call_osafterfork, 0},
{0, 0, 0, 0, 0, 0, 0},
};
@@ -377,6 +379,11 @@ void uwsgi_python_post_fork() {
UWSGI_GET_GIL
}
// reset python signal flags so child processes can trap signals
if (up.call_osafterfork) {
PyOS_AfterFork();
}
uwsgi_python_reset_random_seed();
// call the post_fork_hook