summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2020-02-06 18:25:25 +0300
committerAndrei Belov <defan@nginx.com>2020-02-06 18:25:25 +0300
commit2dc01938cf02cc05b41a09e618f712129c4cdf91 (patch)
tree556dd40a0ec8c194774d53eed9ff62ed1d25ee7c /src/nxt_router.c
parent477a58e14010ab14d6ab453860b360cf806f5012 (diff)
parent6e19090736612b39d4c5d0836d7df0722b8955e7 (diff)
downloadunit-2dc01938cf02cc05b41a09e618f712129c4cdf91.tar.gz
unit-2dc01938cf02cc05b41a09e618f712129c4cdf91.tar.bz2
Merged with the default branch.1.15.0-1
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 6a1f3792..3ff048c5 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -3750,8 +3750,6 @@ nxt_router_response_error_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg,
nxt_router_app_prepare_request(task, req_app_link);
}
- nxt_request_app_link_use(task, req_app_link, -1);
-
msg->port_msg.last = 0;
return;
@@ -4220,28 +4218,23 @@ re_ra_cancelled:
if (nxt_router_port_post_select(task, &state) == NXT_OK) {
/*
* There should be call nxt_request_app_link_inc_use(re_ra),
- * but we need to decrement use then. So, let's skip both.
+ * because of one more link in the queue.
+ * Corresponding decrement is in nxt_router_app_process_request().
*/
+ nxt_request_app_link_inc_use(re_ra);
+
nxt_work_queue_add(&task->thread->engine->fast_work_queue,
nxt_router_app_process_request,
&task->thread->engine->task, app, re_ra);
-
- } else {
- /*
- * This call should be unconditional, but we want to spare
- * couple of CPU ticks to postpone the head death of the universe.
- */
-
- nxt_request_app_link_use(task, re_ra, -1);
}
}
if (req_app_link != NULL) {
/*
- * Here we do the same trick as described above,
- * but without conditions.
- * Skip required nxt_request_app_link_inc_use(req_app_link).
+ * There should be call nxt_request_app_link_inc_use(req_app_link),
+ * because of one more link in the queue. But one link was
+ * recently removed from app->requests link.
*/
nxt_work_queue_add(&task->thread->engine->fast_work_queue,
@@ -5205,8 +5198,6 @@ nxt_router_app_timeout(nxt_task_t *task, void *obj, void *data)
if (nxt_router_port_post_select(task, &state) == NXT_OK) {
nxt_router_app_prepare_request(task, pending_ra);
}
-
- nxt_request_app_link_use(task, pending_ra, -1);
}
nxt_debug(task, "send quit to app '%V' pid %PI", &app->name, port->pid);