child_process: watch child_process stdin pipe peer close event - #62353
Open
Tseian wants to merge 1 commit into
Open
child_process: watch child_process stdin pipe peer close event#62353Tseian wants to merge 1 commit into
Tseian wants to merge 1 commit into
Conversation
Tseian
force-pushed
the
main
branch
3 times, most recently
from
March 21, 2026 06:11
071fa18 to
4cedb07
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62353 +/- ##
=======================================
Coverage 90.17% 90.18%
=======================================
Files 770 770
Lines 264483 264547 +64
Branches 50262 50284 +22
=======================================
+ Hits 238491 238571 +80
+ Misses 16981 16944 -37
- Partials 9011 9032 +21
🚀 New features to boost your workflow:
|
Tseian
force-pushed
the
main
branch
2 times, most recently
from
March 21, 2026 08:21
0ae2360 to
09463c0
Compare
Tseian
force-pushed
the
main
branch
2 times, most recently
from
March 21, 2026 14:26
9e25a20 to
78acd67
Compare
Tseian
force-pushed
the
main
branch
3 times, most recently
from
March 22, 2026 01:43
e704d96 to
8cc7608
Compare
Contributor
Author
|
@nodejs-github-bot retest |
Contributor
Author
|
@jasnell @ronag @jbunton-atlassian Hi everyone, Could you please have a code review for this PR? |
jasnell
reviewed
Mar 23, 2026
jasnell
reviewed
Mar 23, 2026
jasnell
reviewed
Mar 23, 2026
Contributor
Author
|
@jasnell Please have a code review again for this PR.
|
addaleax
reviewed
Mar 24, 2026
Tseian
force-pushed
the
main
branch
2 times, most recently
from
March 25, 2026 04:13
574f851 to
1a34143
Compare
Tseian
force-pushed
the
main
branch
3 times, most recently
from
June 6, 2026 08:48
8dce898 to
c223580
Compare
Watch the child end of the stdin pipe for peer-close (EOF) events, only supported on non-Windows platforms. When the child closes its end of the pipe, subprocess.stdin is destroyed so that its 'close' event is emitted, instead of only being reported as an EPIPE error on the next write. Fixes: nodejs#25131
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.
Issue
#25131
Description
Watch pipe peer close(EOF/HUP) event, only support for unix. Once the event is detected, a JS callback is triggered to execute, which in turn triggers a method to destroy the socket. Eventually child_process.stdin.on('close') will be triggered.
Before
child_process.stdin.on('close') will not be triggered if the readable end of the pipe has been closed.
After
child_process.stdin.on('close') will be triggered if the readable end of the pipe has been closed.
Changes
Test