diff --git a/plugins/gevent/gevent.c b/plugins/gevent/gevent.c index 15782fcf..9838ef56 100644 --- a/plugins/gevent/gevent.c +++ b/plugins/gevent/gevent.c @@ -100,6 +100,31 @@ retry: return Py_None; } +PyObject *py_uwsgi_gevent_int(PyObject *self, PyObject *args) { + + uwsgi_log("Brutally killing worker %d (pid: %d)...\n", uwsgi.mywid, uwsgi.mypid); + uwsgi.workers[uwsgi.mywid].manage_next_request = 0; + + uwsgi_log_verbose("stopping gevent signals watchers for worker %d (pid: %d)...\n", uwsgi.mywid, uwsgi.mypid); + PyObject_CallMethod(ugevent.my_signal_watcher, "stop", NULL); + PyObject_CallMethod(ugevent.signal_watcher, "stop", NULL); + + uwsgi_log_verbose("stopping gevent sockets watchers for worker %d (pid: %d)...\n", uwsgi.mywid, uwsgi.mypid); + int i,count = uwsgi_count_sockets(uwsgi.sockets); + for(i=0;i