Skip to content

Conversation

@dabla
Copy link
Contributor

@dabla dabla commented Nov 13, 2025

I discovered a bug in the run_trigger method of the TriggerRunner by accident due to the fact that I added typing to the trigger parameter when working on PR #51391.

There I got the following MyPy error from the Airflow CI/CD:

airflow-core/src/airflow/jobs/triggerer_job_runner.py:1182: error: "BaseTrigger" has no attribute "timeout_after"  [attr-defined]
                  if timeout := trigger.timeout_after:

First I thought I did a mistake with the typing, but after closer investigation the typing was correct and so was also the MyPy error. Then I discovered that the timeout_after attribute was indeed never part of the BaseTrigger but was part of the workloads.RunTrigger model. So I refactored the run_trigger method so that beside trigger_id and trigger (now typed as BaseTrigger), now also has the optional timeout_after parameter which is passed from the workloads.RunTrigger model.

I don't know if this has ever lead to any issue at runtime, but I would certainly lead to an exception if a trigger would be cancelled.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Copy link
Member

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! However, it seems the CI still needs fix, thanks!

@dabla
Copy link
Contributor Author

dabla commented Nov 14, 2025

Nice catch! However, it seems the CI still needs fix, thanks!

Yes I think I closed my laptop too fast, the commit with the fix wasn't included ;-)

@dabla
Copy link
Contributor Author

dabla commented Nov 14, 2025

Nice catch! However, it seems the CI still needs fix, thanks!

CI is fixed

@dabla dabla requested a review from jason810496 November 14, 2025 10:40
@dabla dabla requested a review from jason810496 November 21, 2025 09:52
@jason810496 jason810496 added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Nov 21, 2025
@Lee-W Lee-W merged commit 1c3ac6c into apache:main Nov 25, 2025
64 checks passed
@dabla
Copy link
Contributor Author

dabla commented Nov 25, 2025

@thx Lee for merging this!

@Lee-W
Copy link
Member

Lee-W commented Nov 26, 2025

Somehow it's not backported. Let me backport it manually

Lee-W pushed a commit to astronomer/airflow that referenced this pull request Nov 26, 2025
…gerRunner (apache#58282)

(cherry picked from commit 1c3ac6c)

Co-authored-by: David Blain <info@dabla.be>
Lee-W added a commit that referenced this pull request Nov 26, 2025
…gerRunner (#58282) (#58703)

Co-authored-by: David Blain <info@dabla.be>
@potiuk potiuk added this to the Airflow 3.1.4 milestone Dec 2, 2025
ephraimbuddy pushed a commit that referenced this pull request Dec 3, 2025
…gerRunner (#58282) (#58703)

Co-authored-by: David Blain <info@dabla.be>
Copilot AI pushed a commit to jason810496/airflow that referenced this pull request Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Triggerer backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants