From d95da5568b3f6271d853819587c056d5b74a0fa6 Mon Sep 17 00:00:00 2001 From: Daniel Kec Date: Fri, 22 Nov 2024 15:51:34 +0100 Subject: [PATCH] build fix 3 Signed-off-by: Daniel Kec --- .../src/main/java/io/helidon/http/http2/WindowSizeImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/http/http2/src/main/java/io/helidon/http/http2/WindowSizeImpl.java b/http/http2/src/main/java/io/helidon/http/http2/WindowSizeImpl.java index a5debced367..0a77f422042 100644 --- a/http/http2/src/main/java/io/helidon/http/http2/WindowSizeImpl.java +++ b/http/http2/src/main/java/io/helidon/http/http2/WindowSizeImpl.java @@ -164,10 +164,12 @@ public void triggerUpdate() { @Override public void blockTillUpdate() { var startTime = System.currentTimeMillis(); + int backoff = 50; while (getRemainingWindowSize() < 1) { try { updatedSemaphore.drainPermits(); - var ignored = updatedSemaphore.tryAcquire(timeoutMillis / 4, TimeUnit.MILLISECONDS); + var ignored = updatedSemaphore.tryAcquire(Math.min(backoff, 5000), TimeUnit.MILLISECONDS); + backoff *= 2; } catch (InterruptedException e) { debugLog("%s OFC STR %d: Window depleted, waiting for update interrupted.", e); throw new Http2Exception(Http2ErrorCode.FLOW_CONTROL, "Flow control update wait interrupted.");