Uh oh!
There was an error while loading. Please reload this page.
Implement execution_timeout semantics for AirbyteTriggerSyncOperator in deferrable mode - #64051
Conversation
52ddbc1 to
f43e496Compare5d371fb to
e93db98CompareSameerMesiah97
commented
Mar 24, 2026
CI failure is unrelated to my changes. It was present in PR #64084, which only changes the spelling of a 'deferrable' in one of the log messages within the |
There was a problem hiding this comment.
Pull request overview
Enforces execution_timeout semantics for AirbyteTriggerSyncOperator when running in deferrable mode by introducing an absolute execution_deadline passed to the trigger and handling timeout events by cancelling the Airbyte job.
Changes:
- Add
execution_deadlinesupport toAirbyteSyncTrigger(serialization + timeout event emission). - Compute and pass an execution deadline from
AirbyteTriggerSyncOperatorin deferrable mode. - Add/adjust unit tests for trigger timeout events and operator cancellation behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| providers/airbyte/src/airflow/providers/airbyte/triggers/airbyte.py | Add execution_deadline to trigger and emit a timeout event when exceeded. |
| providers/airbyte/src/airflow/providers/airbyte/operators/airbyte.py | Compute deadline before deferring; cancel Airbyte job on timeout event in execute_complete. |
| providers/airbyte/tests/unit/airbyte/triggers/test_airbyte.py | Add serialization coverage for execution_deadline and a trigger-level execution-timeout test. |
| providers/airbyte/tests/unit/airbyte/operators/test_airbyte.py | Add operator-level tests asserting cancellation + failure behavior on execution timeout. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@SameerMesiah97 Converting to draft — this PR doesn't yet meet our Pull Request quality criteria.
See the linked criteria for how to fix each item, then mark the PR "Ready for review". This is not a rejection — just an invitation to bring the PR up to standard. No rush. Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
e228b64 to
21e636fCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
3713243 to
d775e00CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Restore execution_timeout semantics in deferrable mode by propagating timeouts through the trigger and explicitly cancelling Airbyte jobs when the task exceeds its execution deadline. This preserves behavior parity with non-deferrable execution and avoids leaking Airbyte jobs. Add tests covering execution timeout handling in both the operator and trigger, including successful cancellation and best-effort behavior when job cancellation fails.
cb77d1b to
f7260d1CompareThank you for the review. I have addressed all your feedback where appropriate. |
SameerMesiah97
commented
May 4, 2026
I would appreciate another look once you get the time. |
… PR apache#64051 patterns Simplify trigger polling/control flow and propagate execution_timeout via defer Add tests for best-effort cancellation semantics in execute_complete and on_kill
… PR apache#64051 patterns. Simplify trigger polling/control flow and propagate execution_timeout via defer. Add tests for best-effort cancellation semantics in execute_complete and on_kill.
…o align with PR apache#64051 patterns. Simplify trigger polling/control flow and propagate execution_timeout via defer. Add tests for best-effort cancellation semantics in execute_complete and on_kill. (apache#66449) (cherry picked from commit bc8ef9a) Co-authored-by: SameerMesiah97 <75502260+SameerMesiah97@users.noreply.github.com>
SameerMesiah97
commented
May 16, 2026
Requesting review for this. |
…o align with PR apache#64051 patterns. Simplify trigger polling/control flow and propagate execution_timeout via defer. Add tests for best-effort cancellation semantics in execute_complete and on_kill. (apache#66449) (cherry picked from commit bc8ef9a) Co-authored-by: SameerMesiah97 <75502260+SameerMesiah97@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
…o align with PR #64051 patterns. Simplify trigger polling/control flow and propagate execution_timeout via defer. Add tests for best-effort cancellation semantics in execute_complete and on_kill. (#66449) (cherry picked from commit bc8ef9a) Co-authored-by: SameerMesiah97 <75502260+SameerMesiah97@users.noreply.github.com>
…o align with PR #64051 patterns. Simplify trigger polling/control flow and propagate execution_timeout via defer. Add tests for best-effort cancellation semantics in execute_complete and on_kill. (#66449) (cherry picked from commit bc8ef9a) Co-authored-by: SameerMesiah97 <75502260+SameerMesiah97@users.noreply.github.com>
Description
This change enforces
execution_timeoutforAirbyteTriggerSyncOperatorin deferrable mode.Previously, when the operator deferred,
execution_timeoutwas not enforced, allowing Airbyte jobs to continue running after the Airflow task had timed out.The operator now computes an execution deadline before deferring, the trigger emits a timeout event when the deadline is exceeded, and the operator cancels the Airbyte job and fails the task when the event is received.
Rationale
In non-deferrable mode,
execution_timeoutis enforced by the scheduler, which terminates the task process and invokeson_kill()to cancel the external Airbyte job.In deferrable mode, execution is handed off to a trigger running in the triggerer process, so there is no worker process to terminate. However, this does not change the expected task semantics. From a user perspective,
execution_timeoutis a hard task-level limit and should behave consistently regardless of execution mode.Without explicit handling in the trigger/operator interaction,
execution_timeoutbecomes a no-op in deferrable mode, leading to leaked Airbyte jobs and inconsistent behavior.This is the same class of issue addressed in PR #61472 for
DbtCloudRunJobOperator.Notes
timeoutparameter only controls how long the operator waits for job completion and does not imply cancellation.execution_timeoutandtimeoutare set, the earlier deadline takes precedence.execute_complete, several genericAirflowExceptionraises have been replaced with more appropriate, specific exception types.on_killfor consistency; cancellation errors are logged and not re-raised.Tests
on_killdoes not raise ifcancel_jobfails (best-effort behavior).execution_deadlinefield is always serialized.Documentation
execution_deadlineparameter.timeoutvsexecution_timeout; added an entry forexecution_timeout.Backwards Compatibility
This change does not modify public APIs or method signatures.
Behavior is changed such that Airbyte jobs are now cancelled when
execution_timeoutis reached in deferrable mode. Previously, jobs could continue running after the task timed out.Closes: #64048