summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Dumpleton <Graham.Dumpleton@gmail.com>2021-08-03 18:05:23 +1000
committerGraham Dumpleton <Graham.Dumpleton@gmail.com>2021-08-03 18:05:23 +1000
commit458f67ccf808912dd711266fbfa4442a89c0c0d7 (patch)
tree90979d84e5eb4709541280c69e5d3cecee9a50e8
parentb85d335cc54b883b056c876a8a460505fe829218 (diff)
downloadmod_wsgi-458f67ccf808912dd711266fbfa4442a89c0c0d7.tar.gz
Adding logging for startup timeout.
-rw-r--r--src/server/mod_wsgi.c40
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