From 4080c734601877f8b2a4ec9691975ab184d9ceb5 Mon Sep 17 00:00:00 2001 From: anuragg-saxenaa Date: Sun, 12 Apr 2026 12:05:21 -0400 Subject: [PATCH] fix: catch UncheckedIOException in RetryableStage to allow retry (#6578) RetryableStage caught SdkException and IOException but not UncheckedIOException (which extends RuntimeException, not IOException). When the HTTP client throws UncheckedIOException, it bypassed the catch block entirely and was never offered to the retry strategy predicates, so retryOnException(UncheckedIOException.class) had no effect. Add UncheckedIOException to the multi-catch so it is forwarded to RetryableStageHelper.tryRefreshToken and evaluated against user-supplied retry predicates like any other retriable exception. Fixes #6578 Signed-off-by: anuragg-saxenaa --- .../core/internal/http/pipeline/stages/RetryableStage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/RetryableStage.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/RetryableStage.java index a545cb4b088e..7482b0c63f6d 100644 --- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/RetryableStage.java +++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/pipeline/stages/RetryableStage.java @@ -16,6 +16,7 @@ package software.amazon.awssdk.core.internal.http.pipeline.stages; import java.io.IOException; +import java.io.UncheckedIOException; import java.time.Duration; import java.util.Optional; import java.util.concurrent.TimeUnit; @@ -56,7 +57,7 @@ public Response execute(SdkHttpFullRequest request, RequestExecutionCon Response response = executeRequest(retryableStageHelper, context); retryableStageHelper.recordAttemptSucceeded(); return response; - } catch (SdkExceptionWithRetryAfterHint | SdkException | IOException e) { + } catch (SdkExceptionWithRetryAfterHint | SdkException | IOException | UncheckedIOException e) { Throwable throwable = e; if (e instanceof SdkExceptionWithRetryAfterHint) { SdkExceptionWithRetryAfterHint wrapper = (SdkExceptionWithRetryAfterHint) e;