You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DataprocSubmitTrigger and DataprocSubmitJobDirectTrigger now cancel in-flight Dataproc jobs via BaseTrigger.on_kill() when the user kills the deferred task, instead of catching asyncio.CancelledError in run() and using safe_to_cancel() to guess whether the triggerer was restarting. Polling in run() is unchanged aside from no longer handling cancellation there; cancel_on_kill and job_id still gate whether cancel_job runs.
Unit tests assert that CancelledError during polling does not call cancel_job, and that on_kill() performs the cancel (or skips when cancel_on_kill is false or job_id is missing).
For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why you removed this. This will break cancellation semantics for this trigger for the Airflow 3.x versions before 3.30 (which appears to be the version where on_kill() is being introduced in BaseTrigger).
The reason will be displayed to describe this comment to others. Learn more.
You’re removing quite a bit of existing code here, which introduces a backwards compatibility issue for pre-3.30 Airflow. In those versions on_kill() isn’t invoked, so cancellation would no longer go through. I’d have another look at PR #65672; there on_kill() is added without removing the existing CancelledError path.
I think it would be better to just add on_kill() (with tests) and leave the current logic in run() as-is. That way older versions continue to use the existing code path, and newer versions can make use of on_kill() when it’s available.
❌ Pre-commit / static checks: Failing: CI image checks / Static checks. Run prek run --from-ref main --stage pre-commit locally to reproduce and fix the offending hooks.
What to do next:
Fix each issue listed above.
Make sure static checks pass locally (prek run --from-ref main --stage pre-commit).
Mark the PR as "Ready for review" when you're done.
There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the Airflow Slack.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DataprocSubmitTriggerandDataprocSubmitJobDirectTriggernow cancel in-flight Dataproc jobs viaBaseTrigger.on_kill()when the user kills the deferred task, instead of catchingasyncio.CancelledErrorinrun()and usingsafe_to_cancel()to guess whether the triggerer was restarting. Polling inrun()is unchanged aside from no longer handling cancellation there;cancel_on_killandjob_idstill gate whethercancel_jobruns.Unit tests assert that
CancelledErrorduring polling does not callcancel_job, and thaton_kill()performs the cancel (or skips whencancel_on_killis false orjob_idis missing).related: #65733
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.