fix: catch UncheckedIOException in RetryableStage to enable retry (#6578)#6856
Open
anuragg-saxenaa wants to merge 1 commit intoaws:masterfrom
Open
Conversation
…#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 aws#6578 Signed-off-by: anuragg-saxenaa <anuragg.saxenaa@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
RetryableStagecatchesSdkException | IOExceptionbut notUncheckedIOException. SinceUncheckedIOExceptionextendsRuntimeException(notIOException), it bypasses the catch block and is never evaluated against user-supplied retry predicates. This meansretryOnException(UncheckedIOException.class)has no effect.Root Cause
Fix
Adding
UncheckedIOExceptionto the multi-catch means it is forwarded toRetryableStageHelper.tryRefreshToken, which evaluates user-supplied retry predicates correctly. No other behavior changes —UncheckedIOExceptionwill only be retried when the user explicitly registers a predicate that matches it (e.g.retryOnException(UncheckedIOException.class)).Fixes #6578