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 75.38462% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.67%. Comparing base (69fdff9) to head (78acd67).
⚠️ 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 ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #62353   +/-   ##
=======================================
  Coverage   89.67%   89.67%           
=======================================
  Files         676      676           
  Lines      206693   206756   +63     
  Branches    39576    39594   +18     
=======================================
+ Hits       185346   185418   +72     
+ Misses      13482    13453   -29     
- Partials     7865     7885   +20     
Files with missing lines Coverage Δ
lib/internal/child_process.js 94.69% <100.00%> (-0.24%) ⬇️
src/pipe_wrap.h 100.00% <ø> (ø)
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 changed the title child-process: watch pipe peer close event child-process: watch child_process stdin pipe peer close event Mar 21, 2026
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