summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-07-23 14:25:46 +0300
committerMax Romanov <max.romanov@nginx.com>2020-07-23 14:25:46 +0300
commit762511c5105119c45c676578f45473c7f906de60 (patch)
tree6becc6fb5968144ca2ed90f268a1dba62b4c14d1 /src/nxt_router.c
parent9641fb0ef1d708bb9ec8c00ea5ec694829e4fd67 (diff)
downloadunit-762511c5105119c45c676578f45473c7f906de60.tar.gz
unit-762511c5105119c45c676578f45473c7f906de60.tar.bz2
Fixing request_app_link reference counting.
Racing conditions reproduced periodically on test_python_process_switch.
Diffstat (limited to 'src/nxt_router.c')
-rw-r--r--src/nxt_router.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nxt_router.c b/src/nxt_router.c
index 88b87323..bf82501c 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -731,9 +731,7 @@ nxt_request_app_link_release_handler(nxt_task_t *task, void *obj, void *data)
nxt_assert(req_app_link->work.data == data);
- nxt_atomic_fetch_add(&req_app_link->use_count, -1);
-
- nxt_request_app_link_release(task, req_app_link);
+ nxt_request_app_link_use(task, req_app_link, -1);
}
@@ -4695,7 +4693,7 @@ nxt_router_port_select(nxt_task_t *task, nxt_port_select_state_t *state)
&req_app_link->link_app_requests);
}
- ra_use_delta++;
+ nxt_request_app_link_inc_use(req_app_link);
nxt_debug(task, "req_app_link stream #%uD enqueue to app->requests",
req_app_link->stream);