Stale workers not exiting after reload (with HTTP/2 long poll requests)
|Reported by:||Owned by:|
|Keywords:||HTTP2, longpoll, keepalive||Cc:|
|uname -a:||3.16.0-60-generic 80~14.04.1-Ubuntu|
|nginx -V:||built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) built with OpenSSL 1.0.2j 26 Sep 2016 TLS SNI support enabled configure arguments: --with-http_ssl_module --with-http_v2_module --with-openssl=/PATH/TO/OPENSSL/openssl-1.0.2j|
Nginx stale workers not exiting with HTTP/2 long poll requests.
Based on the commit info in http://hg.nginx.org/nginx/rev/ea284434db0f, it seems that connections with active streams should be closed if nginx is exiting (e.g. after a reload). But for long poll requests, where there could always be active streams in the connection, it seems that
ngx_http_v2_finalize_connection() (and maybe also
ngx_http_v2_handle_connection_handler()) may not have a chance to be reached because of the non-zero
The issue can be reproduced by sending long poll HTTP/2 requests to Nginx.
- Enable HTTP/2 on an Nginx server.
- Configure the upstream server to return the response X seconds after receiving the request.
- Generate HTTP/2 traffic using tools such as
- Reload Nginx after seeing some number of requests.
- It can be observed that requests are still sent to the old worker (include
pidin the access log), and the stale worker would not exit.