]> git.kaiwu.me - nginx.git/commitdiff
Process events posted by ngx_close_idle_connections() immediately.
authorRoman Arutyunyan <arut@nginx.com>
Fri, 18 Nov 2022 15:31:38 +0000 (19:31 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Fri, 18 Nov 2022 15:31:38 +0000 (19:31 +0400)
Previously, if an event was posted by a read event handler, called by
ngx_close_idle_connections(), that event was not processed until the next
event loop iteration, which could happen after a timeout.

src/os/unix/ngx_process_cycle.c
src/os/win32/ngx_process_cycle.c

index 07cd05e80b621abd834dc975ae7a7501c0cae33f..821539bb717b845d17495b690095dda123086e67 100644 (file)
@@ -736,6 +736,7 @@ ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
                 ngx_set_shutdown_timer(cycle);
                 ngx_close_listening_sockets(cycle);
                 ngx_close_idle_connections(cycle);
+                ngx_event_process_posted(cycle, &ngx_posted_events);
             }
         }
 
index 3aea874e01bd4c1fbb1d7024570163f44bf72856..0c848eff4f8b7775cfa835f99c5c7d9d2505e788 100644 (file)
@@ -804,6 +804,7 @@ ngx_worker_thread(void *data)
                 ngx_set_shutdown_timer(cycle);
                 ngx_close_listening_sockets(cycle);
                 ngx_close_idle_connections(cycle);
+                ngx_event_process_posted(cycle, &ngx_posted_events);
             }
         }