You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ayanhussain81 (via GitHub)" <gi...@apache.org> on 2026/09/01 12:23:08 UTC
[PR] Fix email callback bundle_version for unpinned Dag runs [airflow]
ayanhussain81 opened a new pull request, #72370:
URL: https://github.com/apache/airflow/pull/72370
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
PR #66485 fixed scheduler-emitted `TaskCallbackRequest`s (external kill, heartbeat
timeout, stuck-in-queued) to source `bundle_version` from `dag_run.bundle_version`
instead of `DagVersion.bundle_version`, so that callbacks for Dags with
`disable_bundle_versioning=True` stay unpinned and run against the same on-disk
code the task did, instead of pinning to a version the run was never pinned to.
That fix touched three call sites but missed a fourth: the `EmailRequest` built a
few lines below the `TaskCallbackRequest` in `process_executor_events`'s
external-kill path. It still falls back to `DagVersion.bundle_version` whenever
`dag_version` is set, regardless of whether `dag_run.bundle_version` is `None`.
For a Dag with `disable_bundle_versioning=True` and `email_on_failure`/
`email_on_retry` configured, when a task is detected as externally killed, the
failure/retry email ends up pinned to a stale bundle version the run was never
pinned to — causing the Dag Processor to check out an unnecessary
`versions/<sha>/` working tree for that email callback (the exact class of
problem #66485 set out to fix, just through the one path it didn't touch).
This applies the same guard used at the other three call sites (and used by the
`_resolve_ti_callback_bundle_info` helper, whose own docstring says
`process_executor_events` "inlines the same resolution" — this brings it back in
sync), and adds a regression test mirroring the existing
`test_external_kill_callback_bundle_version_follows_dag_run` for the `EmailRequest`
path, since the existing `TestSchedulerCallbackBundleInfoDagVersionNullable` suite
verifies a reimplementation of the logic rather than the real per-callsite code,
which is how this one diverged unnoticed.
Verified locally: the new test fails against the pre-fix code
(`AssertionError: -'abc123-sha' +None`) and passes with the fix; the full
`bundle_version` / `process_executor_events` / heartbeat-timeout test surface in
`test_scheduler_job.py` passes with no regressions; `ruff check` and
`ruff format --check` are clean on both changed files.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
<!--
Generated-by: Claude Code following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
-->
Claude Code was used to investigate the root cause (via `git blame`/`git log` on the
original fix, and tracing `EmailRequest.bundle_version` through to
`BundleVersionLock`), implement the fix, write the regression test, and run/verify
the test suite. All findings and the diff were reviewed and understood before
submission.
---
* Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines).
* No related issue — this was found via source/history review rather than a bug report.
* Newsfragment (`{pr_number}.bugfix.rst`) will be added as a follow-up commit once this PR's number is known.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix email callback bundle_version for unpinned Dag runs [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi closed pull request #72370: Fix email callback bundle_version for unpinned Dag runs
URL: https://github.com/apache/airflow/pull/72370
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix email callback bundle_version for unpinned Dag runs [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #72370:
URL: https://github.com/apache/airflow/pull/72370#issuecomment-5493881460
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our [Contributors' Guide](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:
- Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
- In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example Dag that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
- Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
Apache Airflow is a community-driven project and together we are making it better 🚀.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://s.apache.org/airflow-slack
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix email callback bundle_version for unpinned Dag runs [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #72370:
URL: https://github.com/apache/airflow/pull/72370#issuecomment-6023864110
Closing in favor of #71425 & #73915
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org