Skip to content

Fix scheduler callback bundle_version when versioning disabled#66485

Merged
ephraimbuddy merged 1 commit into
apache:mainfrom
astronomer:fix-disable-bundle-versioning-callback
May 7, 2026
Merged

Fix scheduler callback bundle_version when versioning disabled#66485
ephraimbuddy merged 1 commit into
apache:mainfrom
astronomer:fix-disable-bundle-versioning-callback

Conversation

@ephraimbuddy
Copy link
Copy Markdown
Contributor

When a DAG has disable_bundle_versioning=True, dag_run.bundle_version is left None at trigger time, but DagVersion.bundle_version still records the bundle SHA captured during DAG parse. Scheduler-emitted task callbacks (zombie tasks, heartbeat timeouts, stuck-in-queued) sourced bundle_version from DagVersion, so the DFP would check out a pinned versions// working tree and write a _tracking lockfile for a SHA the run was never pinned to — causing the callback to run against different code than the task itself, leaving per-version checkouts on disk, and blocking stale bundle cleanup.

Source bundle_version from dag_run.bundle_version so the callback inherits the same unpinned state as the run and executes against the same on-disk code the task did.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Opus 4.7

When a DAG has disable_bundle_versioning=True, dag_run.bundle_version is
left None at trigger time, but DagVersion.bundle_version still records
the bundle SHA captured during DAG parse. Scheduler-emitted task
callbacks (zombie tasks, heartbeat timeouts, stuck-in-queued) sourced
bundle_version from DagVersion, so the DFP would check out a pinned
versions/<sha>/ working tree and write a _tracking lockfile for a SHA
the run was never pinned to — causing the callback to run against
different code than the task itself, leaving per-version checkouts on
disk, and blocking stale bundle cleanup.

Source bundle_version from dag_run.bundle_version so the callback
inherits the same unpinned state as the run and executes against the
same on-disk code the task did.
@ephraimbuddy ephraimbuddy requested review from XD-DENG and ashb as code owners May 6, 2026 17:24
@boring-cyborg boring-cyborg Bot added the area:Scheduler including HA (high availability) scheduler label May 6, 2026
@ephraimbuddy ephraimbuddy added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label May 6, 2026
Copy link
Copy Markdown
Contributor

@eladkal eladkal left a comment

Choose a reason for hiding this comment

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

Thank you @ephraimbuddy for this fix

@eladkal eladkal added this to the Airflow 3.2.2 milestone May 6, 2026
@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label May 6, 2026
@ephraimbuddy ephraimbuddy merged commit 38a51dc into apache:main May 7, 2026
80 checks passed
@ephraimbuddy ephraimbuddy deleted the fix-disable-bundle-versioning-callback branch May 7, 2026 07:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request May 7, 2026
…abled (apache#66485)

When a DAG has disable_bundle_versioning=True, dag_run.bundle_version is
left None at trigger time, but DagVersion.bundle_version still records
the bundle SHA captured during DAG parse. Scheduler-emitted task
callbacks (zombie tasks, heartbeat timeouts, stuck-in-queued) sourced
bundle_version from DagVersion, so the DFP would check out a pinned
versions/<sha>/ working tree and write a _tracking lockfile for a SHA
the run was never pinned to — causing the callback to run against
different code than the task itself, leaving per-version checkouts on
disk, and blocking stale bundle cleanup.

Source bundle_version from dag_run.bundle_version so the callback
inherits the same unpinned state as the run and executes against the
same on-disk code the task did.
(cherry picked from commit 38a51dc)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request May 7, 2026
…abled (apache#66485)

When a DAG has disable_bundle_versioning=True, dag_run.bundle_version is
left None at trigger time, but DagVersion.bundle_version still records
the bundle SHA captured during DAG parse. Scheduler-emitted task
callbacks (zombie tasks, heartbeat timeouts, stuck-in-queued) sourced
bundle_version from DagVersion, so the DFP would check out a pinned
versions/<sha>/ working tree and write a _tracking lockfile for a SHA
the run was never pinned to — causing the callback to run against
different code than the task itself, leaving per-version checkouts on
disk, and blocking stale bundle cleanup.

Source bundle_version from dag_run.bundle_version so the callback
inherits the same unpinned state as the run and executes against the
same on-disk code the task did.
(cherry picked from commit 38a51dc)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
potiuk pushed a commit that referenced this pull request May 10, 2026
…abled (#66485)

When a DAG has disable_bundle_versioning=True, dag_run.bundle_version is
left None at trigger time, but DagVersion.bundle_version still records
the bundle SHA captured during DAG parse. Scheduler-emitted task
callbacks (zombie tasks, heartbeat timeouts, stuck-in-queued) sourced
bundle_version from DagVersion, so the DFP would check out a pinned
versions/<sha>/ working tree and write a _tracking lockfile for a SHA
the run was never pinned to — causing the callback to run against
different code than the task itself, leaving per-version checkouts on
disk, and blocking stale bundle cleanup.

Source bundle_version from dag_run.bundle_version so the callback
inherits the same unpinned state as the run and executes against the
same on-disk code the task did.
(cherry picked from commit 38a51dc)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
potiuk pushed a commit that referenced this pull request May 10, 2026
…abled (#66485) (#66518)

When a DAG has disable_bundle_versioning=True, dag_run.bundle_version is
left None at trigger time, but DagVersion.bundle_version still records
the bundle SHA captured during DAG parse. Scheduler-emitted task
callbacks (zombie tasks, heartbeat timeouts, stuck-in-queued) sourced
bundle_version from DagVersion, so the DFP would check out a pinned
versions/<sha>/ working tree and write a _tracking lockfile for a SHA
the run was never pinned to — causing the callback to run against
different code than the task itself, leaving per-version checkouts on
disk, and blocking stale bundle cleanup.

Source bundle_version from dag_run.bundle_version so the callback
inherits the same unpinned state as the run and executes against the
same on-disk code the task did.
(cherry picked from commit 38a51dc)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Scheduler including HA (high availability) scheduler backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants