Skip to content

Preserve AWS waiter outcomes in trigger events - #72455

Merged
vincbeck merged 1 commit into
apache:mainfrom
SameerMesiah97:AWS-Trigger-Extension
Sep 4, 2026
Merged

vincbeck merged 1 commit into
apache:mainfrom
SameerMesiah97:AWS-Trigger-Extension

Conversation

@SameerMesiah97

Copy link
Copy Markdown
Contributor

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?
  • 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 2, 2026
… exhaustion, and allow AWS triggers to customize exception-to-event translation without reimplementing the shared waiter lifecycle.
@SameerMesiah97
SameerMesiah97 marked this pull request as ready for review September 3, 2026 20:19
@vincbeck
vincbeck merged commit 6815d04 into apache:main Sep 4, 2026
160 checks passed
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.

2 participants