child_process: watch child_process stdin pipe peer close event#62353
child_process: watch child_process stdin pipe peer close event#62353Tseian wants to merge 4 commits intonodejs:mainfrom
Conversation
071fa18 to
4cedb07
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62353 +/- ##
==========================================
- Coverage 89.68% 89.68% -0.01%
==========================================
Files 676 676
Lines 206710 206772 +62
Branches 39584 39609 +25
==========================================
+ Hits 185398 185438 +40
- Misses 13441 13444 +3
- Partials 7871 7890 +19
🚀 New features to boost your workflow:
|
0ae2360 to
09463c0
Compare
9e25a20 to
78acd67
Compare
e704d96 to
8cc7608
Compare
|
@nodejs-github-bot retest |
|
@jasnell @ronag @jbunton-atlassian Hi everyone, Could you please have a code review for this PR? |
src/pipe_wrap.cc
Outdated
| wrap->peer_close_watching_ = false; | ||
| wrap->peer_close_cb_.Reset(); | ||
| } | ||
| args.GetReturnValue().Set(err); |
There was a problem hiding this comment.
Is the err return value actually used on the JavaScript side? If it is, I'm not seeing where.
There was a problem hiding this comment.
Indeed, it's not currently used in the JS side. Do you mean that if it's not used in the JS side, we shouldn't return a value?
I saw that Bind and Connect both return values, and I assumed this was a convention.
There was a problem hiding this comment.
It no longer returns value.
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