Ignore closed DAG processor loggers during log drain#64996
Open
DaveT1991 wants to merge 1 commit intoapache:mainfrom
Open
Ignore closed DAG processor loggers during log drain#64996DaveT1991 wants to merge 1 commit intoapache:mainfrom
DaveT1991 wants to merge 1 commit intoapache:mainfrom
Conversation
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.
Summary
Prevent DAG processor crashes when late subprocess log events arrive after a DAG file processor's log file handle has already been closed.
process_log_messages_from_subprocess()currently forwards every decoded log event directly to each configured logger. During orphan process termination, buffered socket events can still be delivered after the DAG processor has already closed the corresponding BytesLogger file handle, which raisesValueError: write to closed fileand brings down the whole job.This change treats that specific closed-file logger error as a dropped late log line instead of letting it propagate, and adds regression coverage for the mixed case where one target logger is already closed while another is still able to receive the message.
Closes #64959
Testing
task-sdk/tests/task_sdk/execution_time/test_supervisor.pygit diff --check