Skip to content

child_process: add tracing channel for spawn#61836

Open
marcopiraccini wants to merge 2 commits intonodejs:mainfrom
marcopiraccini:child-process-diagnostic-channel
Open

child_process: add tracing channel for spawn#61836
marcopiraccini wants to merge 2 commits intonodejs:mainfrom
marcopiraccini:child-process-diagnostic-channel

Conversation

@marcopiraccini
Copy link

This PR adds a new child_process.spawn tracing channel wrapping the spawn call. Since spawn is synchronous, this uses start, end, and error events (rather than the async variants).

Events

  • tracing:child_process.spawn:start — published before the native _handle.spawn() call, with { process, options }
  • tracing:child_process.spawn:end — published on successful spawn, with { process }
  • tracing:child_process.spawn:error — published on spawn failure, with { process, error }

Since exec, execFile, and fork all call spawn internally, this single tracing channel covers all child process creation paths (e.g.: https://github.com/nodejs/node/blob/main/lib/child_process.js#L174)

Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
@nodejs-github-bot nodejs-github-bot added child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. labels Feb 15, 2026
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
Copy link
Contributor

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ShogunPanda ShogunPanda added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 16, 2026
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.71%. Comparing base (9cc7fcc) to head (082952e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/child_process.js 75.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61836      +/-   ##
==========================================
- Coverage   89.72%   89.71%   -0.02%     
==========================================
  Files         675      675              
  Lines      204797   204821      +24     
  Branches    39344    39355      +11     
==========================================
  Hits       183752   183752              
- Misses      13324    13338      +14     
- Partials     7721     7731      +10     
Files with missing lines Coverage Δ
lib/internal/child_process.js 94.65% <75.00%> (-0.70%) ⬇️

... and 30 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.

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

Labels

child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants