Welcome! Log In Create A New Profile

Advanced

[nginx] HTTP/2: close connections initialized during graceful shutdown.

Roman Arutyunyan
July 18, 2024 09:50AM
details: https://hg.nginx.org/nginx/rev/d1b8568f3042
branches:
changeset: 9270:d1b8568f3042
user: Kasei Wang <kasei@kasei.im>
date: Thu Jul 18 17:43:25 2024 +0400
description:
HTTP/2: close connections initialized during graceful shutdown.

In some rare cases, graceful shutdown may happen while initializing an HTTP/2
connection. Previously, such a connection ignored the shutdown and remained
active. Now it is gracefully closed prior to processing any streams to
eliminate the shutdown delay.

diffstat:

src/http/v2/ngx_http_v2.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r 072ca4906154 -r d1b8568f3042 src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c Thu Jun 27 17:29:56 2024 +0400
+++ b/src/http/v2/ngx_http_v2.c Thu Jul 18 17:43:25 2024 +0400
@@ -292,6 +292,11 @@ ngx_http_v2_init(ngx_event_t *rev)

c->data = h2c;

+ if (ngx_exiting) {
+ ngx_http_v2_finalize_connection(h2c, NGX_HTTP_V2_NO_ERROR);
+ return;
+ }
+
rev->handler = ngx_http_v2_read_handler;
c->write->handler = ngx_http_v2_write_handler;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] HTTP/2: close connections initialized during graceful shutdown.

Roman Arutyunyan 272 July 18, 2024 09:50AM



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

Online Users

Guests: 158
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready