diff options
author | Max Romanov <max.romanov@nginx.com> | 2019-06-28 12:19:54 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2019-06-28 12:19:54 +0300 |
commit | ce17fef73d1c7e9dacacef305158921b97cdbc96 (patch) | |
tree | 1eb734dda3dd0e440995902e55bf639ab889f5ff | |
parent | 9ea4be7e4ec5d0d24cddb5868aa4920f0298ee67 (diff) | |
download | unit-ce17fef73d1c7e9dacacef305158921b97cdbc96.tar.gz unit-ce17fef73d1c7e9dacacef305158921b97cdbc96.tar.bz2 |
Fixed application crash handling in router.
Before this fix, request in router may hang until timeout expired if
application crashed during request processing.
-rw-r--r-- | src/nxt_router.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c index 149a0ff3..018cd4f4 100644 --- a/src/nxt_router.c +++ b/src/nxt_router.c @@ -928,10 +928,6 @@ nxt_router_remove_pid_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) nxt_port_remove_pid_handler(task, msg); - if (msg->port_msg.stream == 0) { - return; - } - nxt_queue_each(engine, &nxt_router->engines, nxt_event_engine_t, link0) { nxt_port_post(task, engine->port, nxt_router_app_process_remove_pid, @@ -939,6 +935,10 @@ nxt_router_remove_pid_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) } nxt_queue_loop; + if (msg->port_msg.stream == 0) { + return; + } + msg->port_msg.type = _NXT_PORT_MSG_RPC_ERROR; nxt_port_rpc_handler(task, msg); |