The official NGINX Open Source repository.
Go to file
Maxim Dounin c108f04e85 Events: fixed expiration of timers in the past.
If, at the start of an event loop iteration, there are any timers
in the past (including timers expiring now), the ngx_process_events()
function is called with zero timeout, and returns immediately even
if there are no events.  But the following code only calls
ngx_event_expire_timers() if time actually changed, so this results
in nginx spinning in the event loop till current time changes.

While such timers are not expected to appear under normal conditions,
as all such timers should be removed on previous event loop iterations,
they still can appear due to bugs, zero timeouts set in the configuration
(if this is not explicitly handled by the code), or due to external
time changes on systems without clock_gettime(CLOCK_MONOTONIC).

Fix is to call ngx_event_expire_timers() unconditionally.  Calling
it on each event loop iteration is not expected to be significant from
performance point of view, especially compared to a syscall in
ngx_process_events().
2021-03-26 01:44:59 +03:00
auto Mail: realip module. 2021-03-05 17:16:29 +03:00
conf MIME: added font/woff2 type (ticket #1243). 2018-06-15 17:29:55 +03:00
contrib Contrib: vim syntax, default highlighting (ticket #2141). 2021-02-25 23:42:25 +03:00
docs nginx-1.19.8-RELEASE 2021-03-09 18:27:50 +03:00
misc Updated OpenSSL used for win32 builds. 2021-03-09 16:38:55 +03:00
src Events: fixed expiration of timers in the past. 2021-03-26 01:44:59 +03:00
.hgtags release-1.19.8 tag 2021-03-09 18:27:51 +03:00