The "worker process is shutting down" is running all the time, How should I do?

Maxim Dounin mdounin at
Mon Nov 13 13:52:54 UTC 2017


On Fri, Nov 10, 2017 at 05:08:55PM +0800, Vis Lee wrote:

> Hi,
> 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?

What do you mean by "the directives "worker_shutdown_timeout" is 
invalid"?  It does not work for you?

It looks like WebSocket proxying currently fails to handle 
worker_shutdown_timeout requests to close a connection, please try 
the following patch:

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -3314,6 +3314,11 @@ ngx_http_upstream_process_upgraded(ngx_h
+    if (upstream->close || downstream->close) {
+        ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
+        return;
+    }
     if (from_upstream) {
         src = upstream;
         dst = downstream;

Maxim Dounin

More information about the nginx mailing list