From 25bcecade21f1585e04bf2e34fa6433b89fcea2d Mon Sep 17 00:00:00 2001 From: Jaylin <64823539+JaylinYu@users.noreply.github.com> Date: Mon, 14 Apr 2025 17:37:46 +0800 Subject: * FIX [HTTP] fix a blocking case when freeing http client This is a bug I found in the past 2 days. Easily reproduce with low number of taskq_threads and set small timeout duration to http connect aio. --- src/supplemental/http/http_client.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/supplemental/http/http_client.c b/src/supplemental/http/http_client.c index b156794c..b6a70015 100644 --- a/src/supplemental/http/http_client.c +++ b/src/supplemental/http/http_client.c @@ -168,13 +168,11 @@ http_dial_cancel(nni_aio *aio, void *arg, int rv) { nni_http_client *c = arg; nni_mtx_lock(&c->mtx); + nni_aio_abort(c->aio, rv); if (nni_aio_list_active(aio)) { nni_aio_list_remove(aio); nni_aio_finish_error(aio, rv); } - if (nni_list_empty(&c->aios)) { - nni_aio_abort(c->aio, rv); - } nni_mtx_unlock(&c->mtx); } -- cgit v1.2.3-70-g09d2