Skip to content

Distinguish credential failures from AWS waiter exhaustion - #73870

Merged
potiuk merged 3 commits into
apache:mainfrom
SameerMesiah97:AWS-Trigger-Extension-WaiterNoCredentialsError
Oct 5, 2026
Merged

potiuk merged 3 commits into
apache:mainfrom
SameerMesiah97:AWS-Trigger-Extension-WaiterNoCredentialsError

Conversation

@SameerMesiah97

Copy link
Copy Markdown
Contributor

Description

This change distinguishes persistent AWS credential failures from normal waiter exhaustion in the shared waiter utilities.

When every consumed waiter attempt fails with NoCredentialsError, wait and async_wait now raise a dedicated WaiterNoCredentialsError instead of WaiterMaxAttemptsError. Ordinary waiter exhaustion continues to raise WaiterMaxAttemptsError.

This is a follow-up to PR #71653, where preserving distinct waiter outcomes exposed that credential-only exhaustion could otherwise be interpreted as a timeout.

Rationale

NoCredentialsError is currently caught on each waiter attempt and consumes the configured attempt budget. If every attempt fails because credentials are unavailable, the waiter eventually raises WaiterMaxAttemptsError, making credential failure indistinguishable from a resource that simply did not reach a terminal state within the configured attempts.

Preserving this distinction allows consumers such as AWS triggers to report persistent credential failures as errors rather than interpreting them as timeouts.

Tests

Added unit tests verifying that:

  • Synchronous waiters raise WaiterNoCredentialsError when every attempt fails due to missing credentials.
  • Asynchronous waiters raise WaiterNoCredentialsError when every attempt fails due to missing credentials.
  • Synchronous waiters with a mixture of normal waiter attempts and credential failures continue to raise WaiterMaxAttemptsError.
  • Asynchronous waiters with a mixture of normal waiter attempts and credential failures continue to raise WaiterMaxAttemptsError.

Backwards Compatibility

The existing waiter polling and retry behavior is unchanged. WaiterMaxAttemptsError continues to represent ordinary waiter exhaustion; only the credential-only exhaustion case is now represented by the more specific WaiterNoCredentialsError.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [GPT 5.6] following the guidelines

@boring-cyborg boring-cyborg Bot added area:providers provider:amazon AWS/Amazon - related issues labels Sep 28, 2026
@SameerMesiah97
SameerMesiah97 marked this pull request as ready for review September 29, 2026 18:19
@SameerMesiah97
SameerMesiah97 force-pushed the AWS-Trigger-Extension-WaiterNoCredentialsError branch from 0dd50e1 to ea02a7e Compare September 30, 2026 19:05

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The distinction itself is useful, and keeping WaiterNoCredentialsError a subclass of WaiterMaxAttemptsError keeps existing except clauses working. One edge case inline: with zero attempts, the new branch fires without any credentials error having been caught. Happy to approve once that's guarded.


Drafted-by: Claude Code (Opus 5.5); reviewed by @potiuk before posting

Sameer Mesiah and others added 3 commits October 5, 2026 15:53
Raise a dedicated error when every waiter attempt fails due to missing
credentials instead of reporting the outcome as generic waiter
exhaustion. Apply the distinction to both synchronous and asynchronous
waiters and add test coverage for credential-only and mixed attempts.
…e exhausted.

Preserve compatibility by subclassing WaiterMaxAttemptsError and update tests accordingly.
With waiter_max_attempts <= 0 the retry loop never runs, so the
all-attempts-failed-on-credentials flag kept its initial value and the
waiter blamed missing credentials that were never checked.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the AWS-Trigger-Extension-WaiterNoCredentialsError branch from 86faa8b to e159328 Compare October 5, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants