Repository navigation
Stop writing Dag processor log files when the log target is stdout - #74165
Open
luc-pimentel wants to merge 3 commits into
Open
luc-pimentel wants to merge 3 commits into
luc-pimentel wants to merge 3 commits into
Conversation
luc-pimentel
requested review from
ephraimbuddy and
jedcunningham
as code owners
October 3, 2026 14:51
SameerMesiah97
approved these changes
Oct 3, 2026
luc-pimentel
force-pushed
the
fix/70968-dag-processor-stdout-logs
branch
from
October 5, 2026 19:08
a6f2c55 to
02e273e
Compare
With dag_processor_log_target set to stdout, the option promises the parse logs on stdout, yet every parse still appends to a per-file log that nothing reads or removes, so the log directory grows until the disk fills.
dag_processor_log_target = stdout should send the parse logs to stdout instead of files, as the option's description says and as it worked in Airflow 2. Every parse still appended to its file, with the stdout output from apache#65528 on top, so the log directory kept growing although nothing reads or removes those files. Sending the parse process's own logger to stdout, tagged with the Dag file and bundle, also brings the supervisor's messages about a failed parse to stdout, and keeps each line from being printed twice.
The existing stdout test only checks the tags bound to the process logger, so rename it to say that. The new test parses a real Dag file and checks its log line is printed to stdout once, tagged with the Dag file and bundle. The process logger is stdout itself now, so another copy to stdout would print every line twice.
luc-pimentel
force-pushed
the
fix/70968-dag-processor-stdout-logs
branch
from
October 14, 2026 02:29
02e273e to
34ca954
Compare
Contributor
Author
|
Rebased on main and CI passes. Could someone who works on Dag processing please take a look? Thanks! Drafted-by: Claude Code (Fable 5.1); reviewed by @luc-pimentel before posting |
Contributor
Author
|
I saw 3.4.0 was released today, so I ran the same repro from the description against it to see whether this bug is still there and whether the repro still holds. It does: with When a parse process dies, "Process exited abnormally" still goes only to the file in |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
[logging] dag_processor_log_target = stdout, the Dag processor still writes every parse's output tologs/dag_processor/<date>/<bundle>/<file>.log, and since #65528 it also prints the same lines to stdout. Nothing reads or removes those files, so the directory keeps growing. The option's description presentsfileandstdoutas alternatives, and in Airflow 2stdoutreplaced the file handler instead of adding to it.For
stdout,DagFileProcessorManager._get_logger_for_dag_filenow returns a stdout logger tagged withdag_fileandbundle_nameinstead of opening a file. That logger is the parse process's own logger, so the child's output and the supervisor's messages about the parse (such as "Process exited abnormally", which only went to the file before) reach stdout once, in the same format as #65528's output. Nothing copies to stdout a second time anymore, so the_get_target_loggersoverride that tagged that copy is removed, and its tests are replaced by one checking that the stdout logger carries the tags.filemode is unchanged, and the option's description now says thatstdoutwrites no log files.Tested on 3.3.2 and main with
airflow dag-processor -n 3, using a Dag that prints one line and logs one warning when parsed (3 parses):dag_processor_log_targetfilestdoutThe new tests fail without this change.
#71052 tried the same fix and was closed under the open PR limit. If you'd rather keep
stdoutwriting the file too, I can put this behind a newstdout_onlyvalue instead.closes: #70968
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5) following the guidelines