Skip to content

Migrate provider triggers from CancelledError pattern to BaseTrigger.on_kill() #65733

Description

@amoghrajesh

Body

What / Why?

BaseTrigger now has an on_kill() hook ( added via: #65590) that fires only on user-initiated task kills.

Three triggers already implement cancellation but using the old pattern — catching asyncio.CancelledError in run() with a safe_to_cancel() check. These should be migrated.

Tasks

  • DataprocSubmitTrigger
  • DataprocSubmitJobDirectTrigger
  • EmrServerlessStartJobTrigger
  • KubernetesPodTrigger

What to do:

Move the cancellation call out of the CancelledError handler in run(), drop the safe_to_cancel() check, implement on_kill() instead. See the Databricks PR for a reference implementation.

Drop a comment claiming which trigger you will be working on — first to comment gets precedence to avoid duplicate work.

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions