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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants