Skip to content

[v3-4-test] Stop a stale callback stat from forcing constant Dag file reparsing (#73433) - #75939

Merged
vatsrahul1001 merged 1 commit into
apache:v3-4-testfrom
shahar1:backport-73433-v3-4-test
Oct 29, 2026
Merged

vatsrahul1001 merged 1 commit into
apache:v3-4-testfrom
shahar1:backport-73433-v3-4-test

Conversation

@shahar1

@shahar1 shahar1 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Backport of #73433 to v3-4-test. It carries the backport-to-v3-4-test label and the 3.4.0 milestone, but the backport workflow never ran for it after the merge.

A callback leaves a second, never-refreshed stat entry for a Dag file. That entry makes the file look long unparsed, so min_file_process_interval stops excluding it and the Dag processor reparses it on every loop until it restarts. Users hit this on 3.3.x in production (see the discussion on #73433).

The cherry-pick of 72628b5 applies to v3-4-test without conflicts.

related: #73432


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5.5)

Generated-by: Claude Code (Opus 5.5) following the guidelines

… reparsing (apache#73433)

* Stop a stale callback stat from forcing constant Dag file reparsing

A callback pins bundle_version on its DagFileInfo while the bundle scan
leaves it unset, so one file can hold two _file_stats entries. Collapsing
them by presence_key with a dict comprehension keeps whichever was inserted
last, which is the callback entry, and that entry is never refreshed
afterwards because later parses write to the scan key. Its frozen
last_finish_time makes the file look long unparsed, so
min_file_process_interval never excludes it and the processor reparses it on
every loop until it restarts.

Resolve the collapse by the most recent parse instead. _sort_by_mtime and
processed_recently share the same lookup, which previously disagreed with
each other on which duplicate wins.

* Prefer the bundle scan's stat when resolving a file's parse time

Callback runs never record a parse of the current file: a callback-only
stat has no last_finish_time, and a timed-out callback processor is
stamped anyway. Fall back to a versioned stat only when the file has no
scan entry.

* Use only scan stats for queueing and parse metrics

* Use a neutral name for the duplicate-entries test

(cherry picked from commit 72628b5)
@shahar1
shahar1 requested a review from vatsrahul1001 October 29, 2026 07:34
@shahar1
shahar1 enabled auto-merge (squash) October 29, 2026 07:41
@shahar1
shahar1 disabled auto-merge October 29, 2026 07:46
@vatsrahul1001
vatsrahul1001 merged commit dfa73fd into apache:v3-4-test Oct 29, 2026
69 checks passed
@github-actions github-actions Bot added this to the Airflow 3.4.1 milestone Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.4.1 based on: merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants