diff --git a/heavytest.ini b/heavytest.ini index e2c0e7d6..18097c20 100644 --- a/heavytest.ini +++ b/heavytest.ini @@ -1,6 +1,6 @@ [uwsgi] -;master = true +master = true processes = 4 threads = 8 diff --git a/plugins/python/pyloader.c b/plugins/python/pyloader.c index 0f2fb752..338541e1 100644 --- a/plugins/python/pyloader.c +++ b/plugins/python/pyloader.c @@ -319,7 +319,7 @@ int init_uwsgi_app(int loader, void *arg1, struct wsgi_request *wsgi_req, PyThre uwsgi_log( "Web3 application %d (SCRIPT_NAME=%.*s) ready on interpreter %p", id, wi->mountpoint_len, wi->mountpoint, wi->interpreter); } else { - uwsgi_log( "WSGI application %d (SCRIPT_NAME=%.*s) ready on interpreter %p", id, wi->mountpoint_len, wi->mountpoint, wi->interpreter); + uwsgi_log( "WSGI application %d (SCRIPT_NAME=%.*s) ready on interpreter %p pid: %d", id, wi->mountpoint_len, wi->mountpoint, wi->interpreter, (int) getpid()); } if (!wsgi_req->script_name_len) { diff --git a/plugins/python/wsgi_handlers.c b/plugins/python/wsgi_handlers.c index 3af24a51..8dc7477e 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -307,17 +307,18 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { if (uwsgi.threads > 1) { pthread_mutex_lock(&up.lock_pyloaders); } + UWSGI_GET_GIL - if (uwsgi.single_interpreter) { - wsgi_req->app_id = init_uwsgi_app(LOADER_DYN, (void *) wsgi_req, wsgi_req, up.main_thread); - } - else { - wsgi_req->app_id = init_uwsgi_app(LOADER_DYN, (void *) wsgi_req, wsgi_req, NULL); - } + if (uwsgi.single_interpreter) { + wsgi_req->app_id = init_uwsgi_app(LOADER_DYN, (void *) wsgi_req, wsgi_req, up.main_thread); + } + else { + wsgi_req->app_id = init_uwsgi_app(LOADER_DYN, (void *) wsgi_req, wsgi_req, NULL); + } UWSGI_RELEASE_GIL - if (uwsgi.threads > 1) { - pthread_mutex_unlock(&up.lock_pyloaders); - } + if (uwsgi.threads > 1) { + pthread_mutex_unlock(&up.lock_pyloaders); + } } } } @@ -405,6 +406,7 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { } if (wsgi_req->uh.modifier1 == UWSGI_MODIFIER_MANAGE_PATH_INFO) { + wsgi_req->uh.modifier1 = 0; pydictkey = PyDict_GetItemString(wsgi_req->async_environ, "SCRIPT_NAME"); if (pydictkey) { if (PyString_Check(pydictkey)) { @@ -550,7 +552,6 @@ clear2: void uwsgi_after_request_wsgi(struct wsgi_request *wsgi_req) { - if (uwsgi.shared->options[UWSGI_OPTION_LOGGING] || wsgi_req->log_this) { log_request(wsgi_req); }