Skip to content

Commit acb6db3

Browse files
Fix incorrect application of startup timeout.
1 parent 458f67c commit acb6db3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

docs/release-notes/version-4.9.0.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ Bugs Fixed
2424
timeout period had expired, and not as soon as any active requests had
2525
completed, if that had occurred before the graceful timeout had expired.
2626

27+
* When using the ``startup-timeout`` and ``restart-interval`` options of
28+
``WSGIDaemonProcess`` directive together, checking for the expiration
29+
time of the startup time was done incorrectly, resulting in process
30+
restart being delayed if startup had failed. At worst case this was the
31+
lessor of the time periods specified by the options ``restart-interval``,
32+
``deadlock-timeout``, ``graceful-timeout`` and ``eviction-timeout``. If
33+
``request-timeout`` were defined it would however still be calculated
34+
correctly. As ``request-timeout`` was by default defined when using
35+
``mod_wsgi-express``, this issue only usually affect mod_wsgi when
36+
manually configuring Apache.
37+
2738
Features Changed
2839
----------------
2940

src/server/mod_wsgi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9354,7 +9354,8 @@ static void *wsgi_monitor_thread(apr_thread_t *thd, void *data)
93549354
}
93559355
}
93569356
else {
9357-
period = restart_time - now;
9357+
if (!period || ((restart_time - now) < period))
9358+
period = restart_time - now;
93589359
}
93599360
}
93609361
}
@@ -9463,8 +9464,10 @@ static void *wsgi_monitor_thread(apr_thread_t *thd, void *data)
94639464
kill(getpid(), SIGINT);
94649465
}
94659466

9466-
if (restart || wsgi_request_timeout || period <= 0)
9467+
if (restart || wsgi_request_timeout || period <= 0 ||
9468+
(wsgi_startup_timeout && !wsgi_startup_shutdown_time)) {
94679469
period = apr_time_from_sec(1);
9470+
}
94689471

94699472
apr_sleep(period);
94709473
}

0 commit comments

Comments
 (0)