Welcome! Log In Create A New Profile

Advanced

[nginx] Process events posted by ngx_close_idle_connections() immediately.

Roman Arutyunyan
November 23, 2022 03:50AM
details: https://hg.nginx.org/nginx/rev/b809f53d3f5b
branches:
changeset: 8103:b809f53d3f5b
user: Roman Arutyunyan <arut@nginx.com>
date: Fri Nov 18 19:31:38 2022 +0400
description:
Process events posted by ngx_close_idle_connections() immediately.

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.

diffstat:

src/os/unix/ngx_process_cycle.c | 1 +
src/os/win32/ngx_process_cycle.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r 49e7db44b57c -r b809f53d3f5b src/os/unix/ngx_process_cycle.c
--- a/src/os/unix/ngx_process_cycle.c Mon Nov 21 17:01:34 2022 +0300
+++ b/src/os/unix/ngx_process_cycle.c Fri Nov 18 19:31:38 2022 +0400
@@ -736,6 +736,7 @@ ngx_worker_process_cycle(ngx_cycle_t *cy
ngx_set_shutdown_timer(cycle);
ngx_close_listening_sockets(cycle);
ngx_close_idle_connections(cycle);
+ ngx_event_process_posted(cycle, &ngx_posted_events);
}
}

diff -r 49e7db44b57c -r b809f53d3f5b src/os/win32/ngx_process_cycle.c
--- a/src/os/win32/ngx_process_cycle.c Mon Nov 21 17:01:34 2022 +0300
+++ b/src/os/win32/ngx_process_cycle.c Fri Nov 18 19:31:38 2022 +0400
@@ -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);
}
}

_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[nginx] Process events posted by ngx_close_idle_connections() immediately.

Roman Arutyunyan 201 November 23, 2022 03:50AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready