Opened 5 years ago
Closed 5 years ago
#1419 closed defect (fixed)
The "worker process is shutting down" is running all the time, How should I do?
|Reported by:||Owned by:|
|uname -a:||Linux test 2.6.32-279.el6.x86_64|
nginx version: nginx/1.12.1
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
The nginx is http proxy. when i use upgrade websocket and send heartbeat per 5s(client_body_timeout 6s;) the directives
worker_shutdown_timeout is invalid, the "worker process is shutting down" produced by
nginx -s reload is running all the time.
How should I do?
Change History (8)
comment:1 by , 5 years ago
|Status:||new → closed|
comment:2 by , 5 years ago
I think it might be a bug.
I add a patch, The directives
worker_shutdown_timeout can take effect.
Is there a problem? Thx!!!
--- ngx_cycle.c 2017-07-11 21:24:07.000000000 +0800 +++ ../../../patch/ngx_cycle.c 2017-11-04 22:11:52.000000000 +0800 @@ -1379,6 +1379,9 @@ c[i].close = 1; c[i].error = 1; + // the handler maybe ngx_http_upstream_read_request_handler + c[i].read->timedout = 1; + c[i].read->handler(c[i].read); } }
comment:3 by , 5 years ago
timedout flag is not set intentionally, because it is not a connection timeout, but rather a forced connection close. Handlers are expected to look at the
c->close flag. Additionally, the
c->error flag is set as a fallback, so handlers which doesn't handle the
c->close flag directly will still close a connection once they'll try to output anything. That is, while the
ngx_http_upstream_read_request_handler does not handle the `c->close' flag directly, the connection is still expected to be closed once it'll advance to the next state and, for example, will try sending something to the client.
comment:4 by , 5 years ago
|Status:||closed → reopened|
It looks like the problem is that the
worker_shutdown_timeout directive does not work for you in a specific situation, not that nginx rejects it as an invalid. See here for a suggested patch.
comment:5 by , 5 years ago
I will try it. Thank you!
comment:6 by , 5 years ago
The patch is effective. Will be merge into the mainline version?
comment:7 by , 5 years ago
comment:8 by , 5 years ago
|Status:||reopened → closed|
Fix committed, thanks.
For questions, please see support options available. Please avoid using Trac for questions, it is to report bugs.