mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-01 11:15:57 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user