From 762511c5105119c45c676578f45473c7f906de60 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Thu, 23 Jul 2020 14:25:46 +0300 Subject: Fixing request_app_link reference counting. Racing conditions reproduced periodically on test_python_process_switch. --- src/nxt_router.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') 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); -- cgit