From 840b81772234b94359035e0b756d84239f2b520a Mon Sep 17 00:00:00 2001 From: Carlos Fuentes Date: Fri, 3 Jul 2026 12:39:55 +0200 Subject: [PATCH] feat: enable concurrency on idempotent requests --- lib/dispatcher/client-h2.js | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/lib/dispatcher/client-h2.js b/lib/dispatcher/client-h2.js index e22234de8d6..e472ce6830e 100644 --- a/lib/dispatcher/client-h2.js +++ b/lib/dispatcher/client-h2.js @@ -312,29 +312,7 @@ function connectH2 (client, socket) { } if (request != null) { - if (client[kRunning] > 0) { - // We are already processing requests - - // Unlike HTTP/1.1 pipelining, HTTP/2 multiplexes requests on - // independent streams, so non-idempotent requests can be dispatched - // concurrently. Retry eligibility is handled by stream/session error - // handling instead of by serializing all non-idempotent requests. - // Don't dispatch an upgrade until all preceding requests have completed. - // Possibly, we do not have remote settings confirmed yet. - if ((request.upgrade === 'websocket' || request.method === 'CONNECT') && session[kRemoteSettings] === false) return true - // Request with stream or iterator body can error while other requests - // are inflight and indirectly error those as well. - // Ensure this doesn't happen by waiting for inflight - // to complete before dispatching. - - // Request with stream or iterator body cannot be retried. - // Ensure that no other requests are inflight and - // could cause failure. - if (util.bodyLength(request.body) !== 0 && - (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) return true - } else { - return (request.upgrade === 'websocket' || request.method === 'CONNECT') && session[kRemoteSettings] === false - } + return (request.upgrade === 'websocket' || request.method === 'CONNECT') && session[kRemoteSettings] === false } return false