Repository navigation
Fix DagProcessorJob crash on orphan processor kill - #69523
Merged
vatsrahul1001 merged 2 commits intoSep 10, 2026
Merged
Conversation
hkc-8010
requested review from
amoghrajesh,
ashb,
ephraimbuddy,
jedcunningham and
kaxil
as code owners
July 7, 2026 06:16
Contributor
|
LGTM! can we merged post review from code owners |
vatsrahul1001
approved these changes
Jul 29, 2026
kaxil
reviewed
Jul 29, 2026
jason810496
reviewed
Aug 4, 2026
hkc-8010
force-pushed
the
fix/64959-dag-processor-orphan-kill
branch
from
August 23, 2026 09:45
1d79e80 to
9de1c63
Compare
eladkal
force-pushed
the
fix/64959-dag-processor-orphan-kill
branch
from
August 29, 2026 14:28
9de1c63 to
bb538b7
Compare
Contributor
|
@amoghrajesh can you help review this? |
uranusjr
reviewed
Sep 10, 2026
After a processor is SIGKILLed its sockets stay registered on the shared selector, so the next select() callback writes to an already-closed log handle and the job dies with "ValueError: write to closed file". Add WatchedSubprocess.cleanup_sockets_after_kill() to drain the log-bearing sockets, run their close callbacks and unregister them, and call it from DagFileProcessorProcess.close(). Request sockets are closed without being drained so no request frames get dispatched after the kill. Also route supervisor log writes through _log_to_target() so a logger whose handle is already closed is skipped instead of taking the process down. closes: apache#64959
hkc-8010
force-pushed
the
fix/64959-dag-processor-orphan-kill
branch
from
September 10, 2026 07:16
bb538b7 to
0fb21a8
Compare
ephraimbuddy
approved these changes
Sep 10, 2026
Contributor
Backport failed to create: v3-3-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 6d9cc2e v3-3-testThis should apply the commit to the v3-3-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
1 task done
vatsrahul1001
added a commit
that referenced
this pull request
Sep 10, 2026
After a processor is SIGKILLed its sockets stay registered on the shared selector, so the next select() callback writes to an already-closed log handle and the job dies with "ValueError: write to closed file". Add WatchedSubprocess.cleanup_sockets_after_kill() to drain the log-bearing sockets, run their close callbacks and unregister them, and call it from DagFileProcessorProcess.close(). Request sockets are closed without being drained so no request frames get dispatched after the kill. Also route supervisor log writes through _log_to_target() so a logger whose handle is already closed is skipped instead of taking the process down. closes: #64959 (cherry picked from commit 6d9cc2e) Co-authored-by: Hemkumar Chheda <[email protected]>
2 tasks done
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.
Prevent
DagProcessorJobfrom crashing withValueError: write to closed filewhen orphaned or timed-out dag processor subprocesses are killed.
This change drains and deregisters processor log sockets before closing the
logger handle in
DagFileProcessorManager, and narrows supervisor-sideValueErrorhandling so only the closed-log-file case is skipped.It also adds regression coverage for:
closes: #64959
Was generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex (GPT-5) following the guidelines