Skip to content

fix(v4): run the standard retry interceptor after other attempt-completion hooks - #3465

Merged
stobrien89 merged 2 commits into
aws:v4from
stobrien89:crew/smithy-php-protocols/v4-retry-interceptor-order
Nov 27, 2026
Merged

stobrien89 merged 2 commits into
aws:v4from
stobrien89:crew/smithy-php-protocols/v4-retry-interceptor-order

Conversation

@stobrien89

Copy link
Copy Markdown
Member

What

StandardRetryInterceptor now runs after the other modifyBeforeAttemptCompletion hooks: StandardRetryPlugin appends it to the chain. AwsDynamicClient adds S3ErrorPlugin before StandardRetryPlugin, matching generated clients.

Why

A new error thrown in a modify hook ends that hook's chain. With retry first, S3ErrorInterceptor and RetrySafetyInterceptor were skipped on retryable errors, so retried S3 errors reached the caller without x-amz-id-2. Retry now decides last, as in smithy-java and the Smithy interceptor guidance.

Breaking change

The modifyBeforeAttemptCompletion order changes for every service: retry now runs last (before: retry, RetrySafety, S3Error; after: RetrySafety, S3Error, retry).

Testing

New dynamic-client S3 tests (403, 503 SlowDown, 500 InternalError, retry then success) and a RetrySafety test fail without the fix and pass with it; full phpunit, phpstan level 8 and license check pass. Generated S3Client cases follow after #3464.

…etion hooks

StandardRetryPlugin appends its interceptor, and AwsDynamicClient adds it after the S3 error plugin, so S3ErrorInterceptor and RetrySafetyInterceptor shape a retryable error before the retry decision.
@stobrien89
stobrien89 requested a review from smilkuri as a code owner November 27, 2026 21:48
@stobrien89
stobrien89 merged commit b86fb71 into aws:v4 Nov 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant