diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-10-19 17:37:26 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-10-19 17:37:26 +0300 |
commit | fc6520d722d939230b8f9652dfc0a3040622d3df (patch) | |
tree | 71fd6f1d37951cb7957fc603815d8f5235dd016e | |
parent | b3aab8c66fa7269147a6696c98a52971020be6e8 (diff) | |
download | unit-fc6520d722d939230b8f9652dfc0a3040622d3df.tar.gz unit-fc6520d722d939230b8f9652dfc0a3040622d3df.tar.bz2 |
Keep application worker until response for all requests received.
-rw-r--r-- | src/nxt_router.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index 155d1dff..1a9ec32c 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -2644,6 +2644,7 @@ nxt_router_app_port_release(nxt_task_t *task, nxt_port_t *port, { int use_delta, ra_use_delta; nxt_app_t *app; + nxt_bool_t send_quit; nxt_queue_link_t *lnk; nxt_req_app_link_t *ra; @@ -2688,6 +2689,8 @@ nxt_router_app_port_release(nxt_task_t *task, nxt_port_t *port, ra_use_delta = 0; } + send_quit = app->live == 0 && port->app_requests == port->app_responses; + nxt_thread_mutex_unlock(&app->mutex); if (ra != NULL) { @@ -2706,7 +2709,7 @@ nxt_router_app_port_release(nxt_task_t *task, nxt_port_t *port, goto adjust_use; } - if (app->live == 0) { + if (send_quit) { nxt_debug(task, "app '%V' %p is not alive, send QUIT to port", &app->name, app); |