SameerMesiah97 opened a new pull request, #72455: URL: https://github.com/apache/airflow/pull/72455
**Description** This change introduces dedicated exceptions for terminal waiter failures and max-attempt exhaustion in the shared AWS waiter utilities. Both `wait` and `async_wait` now preserve these outcomes through `WaiterTerminalFailure` and `WaiterMaxAttemptsError`, while retaining the existing `AirflowException` hierarchy and existing handling for AWS API errors. `WaiterTerminalFailure` also preserves the waiter's last response so consumers can interpret service-specific terminal states. `AwsBaseWaiterTrigger` now provides an overridable exception-to-event translation method, allowing individual AWS triggers to expose more specific trigger outcomes without reimplementing the shared polling, retry, throttling, credential, and timeout handling. **Rationale** AWS triggers may need to distinguish between different waiter outcomes while still relying on the shared and well-tested waiter lifecycle. Previously, `AwsBaseWaiterTrigger` flattened all waiter failures into a generic error event, requiring triggers that need richer state information to take ownership of the polling loop. Preserving structured waiter outcomes and providing an explicit translation extension point keeps lifecycle handling centralized while allowing service-specific triggers to interpret terminal states where necessary. **Tests** * Added sync and async coverage for terminal waiter failures and preserved waiter responses. * Added sync and async coverage for max-attempt exhaustion. * Added coverage for the default exception-to-event translation in `AwsBaseWaiterTrigger`. **Backwards Compatibility** The new waiter exceptions subclass `AirflowException`, so existing callers handling `AirflowException` continue to work. The default `AwsBaseWaiterTrigger` behavior remains unchanged, with unsuccessful waiter outcomes emitted as generic error events unless a trigger explicitly overrides the translation behavior. ###### 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]
