Welcome! Log In Create A New Profile

Advanced

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

Posted by Vis Lee 
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?

Regards,

leevis
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
The nginx will add timer, the handler is as follows. The
c.read->handler is not processing the 'close' and 'error' flag?

```
static void
ngx_shutdown_timer_handler(ngx_event_t *ev)
{
ngx_uint_t i;
ngx_cycle_t *cycle;
ngx_connection_t *c;

cycle = ev->data;

c = cycle->connections;

for (i = 0; i < cycle->connection_n; i++) {

if (c.fd == (ngx_socket_t) -1
|| c.read == NULL
|| c.read->accept
|| c.read->channel
|| c.read->resolver)
{
continue;
}

ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0,
"*%uA shutdown timeout", c.number);

c.close = 1;
c.error = 1;

c.read->handler(c.read);
}
}

```

2017-11-10 17:08 GMT+08:00 Vis Lee <[email protected]>:

>
> 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?
>
> Regards,
>
> leevis
>
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Hello!

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
return;
}

+ if (upstream->close || downstream->close) {
+ ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
+ return;
+ }
+
if (from_upstream) {
src = upstream;
dst = downstream;

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login