diff --git a/plugins/python/wsgi_handlers.c b/plugins/python/wsgi_handlers.c index b5d1cc27..bcf093f9 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -514,6 +514,11 @@ clear2: void uwsgi_after_request_wsgi(struct wsgi_request *wsgi_req) { if (up.after_req_hook) { + if (uwsgi.harakiri_no_arh) { + // leave harakiri mode + if (uwsgi.workers[uwsgi.mywid].harakiri > 0) + set_harakiri(0); + } PyObject *arh = python_call(up.after_req_hook, up.after_req_hook_args, 0, NULL); if (!arh) { PyErr_Print(); diff --git a/uwsgi.c b/uwsgi.c index 87a735f8..a741b091 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -50,6 +50,9 @@ static struct option long_base_options[] = { {"workers", required_argument, 0, 'p'}, {"harakiri", required_argument, 0, 't'}, {"harakiri-verbose", no_argument, &uwsgi.harakiri_verbose, 1}, + {"harakiri-no-arh", no_argument, &uwsgi.harakiri_no_arh, 1}, + {"no-harakiri-arh", no_argument, &uwsgi.harakiri_no_arh, 1}, + {"no-harakiri-after-req-hook", no_argument, &uwsgi.harakiri_no_arh, 1}, {"spooler-harakiri", required_argument, 0, LONG_ARGS_SPOOLER_HARAKIRI}, {"mule-harakiri", required_argument, 0, LONG_ARGS_MULE_HARAKIRI}, #ifdef UWSGI_XML diff --git a/uwsgi.h b/uwsgi.h index 9da45db2..ccfb9c55 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1338,6 +1338,7 @@ struct uwsgi_server { char *pidfile2; int harakiri_verbose; + int harakiri_no_arh; char *magic_table[256];