Skip to content

Ignore closed DAG processor loggers during log drain#64996

Open
DaveT1991 wants to merge 1 commit intoapache:mainfrom
DaveT1991:fix/ignore-closed-dag-processor-loggers
Open

Ignore closed DAG processor loggers during log drain#64996
DaveT1991 wants to merge 1 commit intoapache:mainfrom
DaveT1991:fix/ignore-closed-dag-processor-loggers

Conversation

@DaveT1991
Copy link
Copy Markdown
Contributor

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 raises ValueError: write to closed file and 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

  • Added regression coverage in task-sdk/tests/task_sdk/execution_time/test_supervisor.py
  • git diff --check

@Saddala
Copy link
Copy Markdown

Saddala commented Apr 10, 2026

Duplicate of #64959 . A fix is being tracked there. PR has been raised on the original issue #64959

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

DAG Processor Job crashes with "ValueError: write to closed file" — race condition in terminate_orphan_processes between SIGKILL and log drain

3 participants