diff options
author | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2021-08-03 18:05:23 +1000 |
---|---|---|
committer | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2021-08-03 18:05:23 +1000 |
commit | 458f67ccf808912dd711266fbfa4442a89c0c0d7 (patch) | |
tree | 90979d84e5eb4709541280c69e5d3cecee9a50e8 | |
parent | b85d335cc54b883b056c876a8a460505fe829218 (diff) | |
download | mod_wsgi-458f67ccf808912dd711266fbfa4442a89c0c0d7.tar.gz |
Adding logging for startup timeout.
-rw-r--r-- | src/server/mod_wsgi.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/server/mod_wsgi.c b/src/server/mod_wsgi.c index 949ff7b..9ad96ce 100644 --- a/src/server/mod_wsgi.c +++ b/src/server/mod_wsgi.c @@ -3925,21 +3925,6 @@ static int wsgi_execute_script(request_rec *r) config = (WSGIRequestConfig *)ap_get_module_config(r->request_config, &wsgi_module); - /* Setup startup timeout if first request and specified. */ - -#if defined(MOD_WSGI_WITH_DAEMONS) - if (wsgi_daemon_process) { - if (wsgi_startup_shutdown_time == 0) { - if (wsgi_startup_timeout > 0) { - apr_thread_mutex_lock(wsgi_monitor_lock); - wsgi_startup_shutdown_time = apr_time_now(); - wsgi_startup_shutdown_time += wsgi_startup_timeout; - apr_thread_mutex_unlock(wsgi_monitor_lock); - } - } - } -#endif - /* * Acquire the desired python interpreter. Once this is done * it is safe to start manipulating python objects. @@ -3955,6 +3940,26 @@ static int wsgi_execute_script(request_rec *r) return HTTP_INTERNAL_SERVER_ERROR; } + /* Setup startup timeout if first request and specified. */ + +#if defined(MOD_WSGI_WITH_DAEMONS) + if (wsgi_daemon_process) { + if (wsgi_startup_shutdown_time == 0) { + if (wsgi_startup_timeout > 0) { + ap_log_error(APLOG_MARK, APLOG_INFO, 0, wsgi_server, + "mod_wsgi (pid=%d): Application startup " + "timer triggered '%s'.", getpid(), + config->process_group); + + apr_thread_mutex_lock(wsgi_monitor_lock); + wsgi_startup_shutdown_time = apr_time_now(); + wsgi_startup_shutdown_time += wsgi_startup_timeout; + apr_thread_mutex_unlock(wsgi_monitor_lock); + } + } + } +#endif + /* * Use a lock around the check to see if the module is * already loaded and the import of the module to prevent @@ -4174,6 +4179,11 @@ static int wsgi_execute_script(request_rec *r) #if defined(MOD_WSGI_WITH_DAEMONS) if (module && wsgi_startup_shutdown_time > 0) { wsgi_startup_shutdown_time = -1; + + ap_log_error(APLOG_MARK, APLOG_INFO, 0, wsgi_server, + "mod_wsgi (pid=%d): Application startup " + "timer cancelled '%s'.", getpid(), + config->process_group); } #endif |