improved gevent graceful reload

This commit is contained in:
roberto@quantal64
2012-08-27 17:52:56 +02:00
parent 5df34ecfd8
commit e904f9f76e
3 changed files with 12 additions and 2 deletions
+4
View File
@@ -1471,6 +1471,7 @@ static void cheaper_algo_list(void) {
uwsgi_log("--- end of cheaper algorithms list ---\n\n");
}
#ifdef UWSGI_ROUTING
static void router_list(void) {
struct uwsgi_router *ur = uwsgi.routers;
uwsgi_log("\n*** uWSGI loaded routers ***\n");
@@ -1480,6 +1481,7 @@ static void router_list(void) {
}
uwsgi_log("--- end of routers list ---\n\n");
}
#endif
static void loop_list(void) {
int i;
@@ -1994,8 +1996,10 @@ int main(int argc, char *argv[], char *envp[]) {
cheaper_algo_list();
#ifdef UWSGI_ROUTING
if (uwsgi.router_list)
router_list();
#endif
if (uwsgi.loop_list)
+6 -2
View File
@@ -47,8 +47,6 @@ struct uwsgi_option gevent_options[] = {
PyObject *py_uwsgi_gevent_graceful(PyObject *self, PyObject *args) {
uwsgi_log("%p %p\n", self, args);
uwsgi_log("Gracefully killing worker %d (pid: %d)...\n", uwsgi.mywid, uwsgi.mypid);
uwsgi.workers[uwsgi.mywid].manage_next_request = 0;
@@ -63,6 +61,10 @@ PyObject *py_uwsgi_gevent_graceful(PyObject *self, PyObject *args) {
}
uwsgi_log("main gevent watchers stopped for worker %d (pid: %d)...\n", uwsgi.mywid, uwsgi.mypid);
if (args) {
exit(UWSGI_RELOAD_CODE);
}
Py_INCREF(Py_None);
return Py_None;
}
@@ -73,6 +75,8 @@ void uwsgi_gevent_gbcw() {
py_uwsgi_gevent_graceful(NULL, NULL);
exit(0);
}
struct wsgi_request *uwsgi_gevent_current_wsgi_req(void) {
+2
View File
@@ -526,7 +526,9 @@ next:
#ifdef UWSGI_EMBEDDED
PyDoc_STRVAR(uwsgi_py_doc, "uWSGI api module.");
#endif
#ifdef PYTHREE