From 2ba8a17a459ddb8ecfd6adf9829374387a4246a7 Mon Sep 17 00:00:00 2001 From: Artem Boldariev Date: Thu, 30 Jan 2025 15:32:38 +0200 Subject: [PATCH] EXP: reduce the number of async HTTP IO requests --- lib/isc/netmgr/http.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/isc/netmgr/http.c b/lib/isc/netmgr/http.c index a00f4a7229..b9e121f88f 100644 --- a/lib/isc/netmgr/http.c +++ b/lib/isc/netmgr/http.c @@ -188,6 +188,8 @@ struct isc_nm_http_session { isc__nm_http_pending_callbacks_t pending_write_callbacks; isc_buffer_t *pending_write_data; + bool async_bio_in_flight; + /* * The statistical values below are for usage on server-side * only. They are meant to detect clients that are taking too many @@ -1639,6 +1641,8 @@ http_do_bio_async_cb(void *arg) { REQUIRE(VALID_HTTP2_SESSION(session)); + session->async_bio_in_flight = false; + if (session->handle != NULL && !isc__nmsocket_closing(session->handle->sock)) { @@ -1655,10 +1659,13 @@ http_do_bio_async(isc_nm_http_session_t *session) { REQUIRE(VALID_HTTP2_SESSION(session)); if (session->handle == NULL || - isc__nmsocket_closing(session->handle->sock)) + isc__nmsocket_closing(session->handle->sock) || + session->async_bio_in_flight) { return; } + + session->async_bio_in_flight = true; isc__nm_httpsession_attach(session, &tmpsess); isc__nm_async_run( &session->handle->sock->mgr->workers[session->handle->sock->tid],