From ce17fef73d1c7e9dacacef305158921b97cdbc96 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Fri, 28 Jun 2019 12:19:54 +0300 Subject: [PATCH] Fixed application crash handling in router. Before this fix, request in router may hang until timeout expired if application crashed during request processing. --- src/nxt_router.c | 8 ++++---- 1 file 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);