Skip to content

child_process: watch child_process stdin pipe peer close event#62353

Open
Tseian wants to merge 1 commit intonodejs:mainfrom
Tseian:main
Open

child_process: watch child_process stdin pipe peer close event#62353
Tseian wants to merge 1 commit intonodejs:mainfrom
Tseian:main

Conversation

@Tseian
Copy link
Contributor

@Tseian Tseian commented Mar 20, 2026

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

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Mar 20, 2026
@Tseian Tseian changed the title child-process: watch pipe peer close event WIP child-process: watch pipe peer close event Mar 20, 2026
@Tseian Tseian force-pushed the main branch 3 times, most recently from 071fa18 to 4cedb07 Compare March 21, 2026 06:11
@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

❌ Patch coverage is 74.62687% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.67%. Comparing base (69fdff9) to head (0b741f4).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/pipe_wrap.cc 71.92% 5 Missing and 11 partials ⚠️
lib/internal/child_process.js 90.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #62353   +/-   ##
=======================================
  Coverage   89.67%   89.67%           
=======================================
  Files         676      676           
  Lines      206693   206756   +63     
  Branches    39576    39592   +16     
=======================================
+ Hits       185346   185412   +66     
+ Misses      13482    13456   -26     
- Partials     7865     7888   +23     
Files with missing lines Coverage Δ
src/pipe_wrap.h 100.00% <ø> (ø)
lib/internal/child_process.js 94.69% <90.00%> (-0.24%) ⬇️
src/pipe_wrap.cc 78.21% <71.92%> (-3.09%) ⬇️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Tseian Tseian force-pushed the main branch 2 times, most recently from 0ae2360 to 09463c0 Compare March 21, 2026 08:21
@Tseian Tseian changed the title WIP child-process: watch pipe peer close event child-process: watch pipe peer close event Mar 21, 2026
@Tseian Tseian force-pushed the main branch 2 times, most recently from 9e25a20 to 78acd67 Compare March 21, 2026 14:26
@Tseian Tseian changed the title child-process: watch pipe peer close event child-process: watch child_process stdin pipe peer close event Mar 21, 2026
@Tseian Tseian force-pushed the main branch 3 times, most recently from e704d96 to 8cc7608 Compare March 22, 2026 01:43
@Tseian Tseian changed the title child-process: watch child_process stdin pipe peer close event child_process: watch child_process stdin pipe peer close event Mar 22, 2026
@Tseian
Copy link
Contributor Author

Tseian commented Mar 22, 2026

@nodejs-github-bot retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants