SameerMesiah97 opened a new pull request, #73870: URL: https://github.com/apache/airflow/pull/73870
**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? - [X] Yes (please specify the tool below) Generated-by: [GPT 5.6] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
