[PATCH] HTTP/2: fixed premature connection closure during reload (ticket #626).

Wai Keen Woon waikeen.woon at onapp.com
Wed Dec 2 10:40:03 UTC 2015


# HG changeset patch
# User Wai Keen Woon <waikeen.woon at onapp.com>
# Date 1449052722 -28800
#      Wed Dec 02 18:38:42 2015 +0800
# Node ID 4b7ef34610ebe00eb6a6d52008a48f9864dadd33
# Parent  be3aed17689c0edd36c2025ff5c36fe493b68bd7
HTTP/2: fixed premature connection closure during reload (ticket #626).

HTTP/2 transfers may be closed prematurely during nginx reload, which logs
"open socket #X left in connection Y" alerts.

ngx_add_timer() isn't called when frames are sent faster than they can be
created. The worker process therefore exits because there are no more timers
scheduled, even though there are more data frames and finalization
forthcoming.

diff -r be3aed17689c -r 4b7ef34610eb src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c    Wed Dec 02 01:06:54 2015 +0300
+++ b/src/http/v2/ngx_http_v2.c    Wed Dec 02 18:38:42 2015 +0800
@@ -535,7 +535,7 @@
          c->tcp_nodelay = NGX_TCP_NODELAY_SET;
      }

-    if (cl) {
+    if (cl || h2c->processing) {
          ngx_add_timer(wev, clcf->send_timeout);

      } else {



More information about the nginx-devel mailing list