GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — inspector: support attaching to a running process in probe mode by joyeecheung · Pull Request #67201 · nodejs/node

Conversation

@joyeecheung

@joyeecheung joyeecheung commented Nov 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Probe mode currently only launches a new process from the entry point script. This change lets it attach to an already-running process, so a long-lived application can be inspected without restarting it.

Running node inspect --probe without specifying an entry point script instructs Node.js to attach to a running Node.js process and probe. The way attaching is done is specified through command line arguments:

  • --pid <pid> activates the target's inspector (if it's not already activated) and connects to it.
  • --host <host> and --port <port> specify an address where an inspector is listening. The host defaults to 127.0.0.1 and the port defaults to 9229.

When the session ends, probe mode resumes and detaches instead of killing a process it does not own. The report now includes a top-level target field describing what was probed, and each probe contains a locations field about where it bound.

An attach session ends when a probe reaches --max-hit (reported as completed), when the target finishes on its own (completed, or miss with the pending probes, and the target is then allowed to exit), or when --timeout fires (reported as timeout, the probing process exit with 0 and reports the hits recorded so far).

--timeout now is also applied to the startup phase in both modes, so a target that never responds before the breakpoints are bound is reported as an error instead of hanging.

# Probing a process by PID, which may not already have the inspector listening.
# End the probing session when the specified probe is reached 5 times.
$ node inspect --probe app.js:42 --expr "req.url" --max-hit 5 --pid 12345

# Probing a process that's already listening for inspector connections at 127.0.0.1:9229.
# End the probing session when the specified timeout is reached.
$ node inspect --probe app.js:42 --expr "req.url" --timeout 50000 --host 127.0.0.1 --port 9229

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added debugger Issues and PRs related to the Node.js command-line debugger. needs-ci PRs that need a full CI run. labels Nov 2, 2026
@joyeecheung
joyeecheung force-pushed the probe-attach-7 branch from 5b94c46 to db767cb Compare November 2, 2026 14:55
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@codecov

codecov Bot commented Nov 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.71831% with 72 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.73%. Comparing base (a10b7ec) to head (7960569).
⚠️ Report is 144 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/debugger/inspect_probe.js 76.92% 64 Missing and 5 partials ⚠️
lib/internal/debugger/inspect.js 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67201      +/-   ##
==========================================
+ Coverage   90.67%   90.73%   +0.06%     
==========================================
  Files         797      798       +1     
  Lines      279611   280358     +747     
  Branches    53779    53967     +188     
==========================================
+ Hits       253547   254393     +846     
+ Misses      16351    16249     -102     
- Partials     9713     9716       +3     
Files with missing lines Coverage Δ
lib/internal/debugger/inspect_client.js 88.04% <100.00%> (+0.09%) ⬆️
lib/internal/debugger/inspect_helpers.js 93.14% <100.00%> (+0.61%) ⬆️
lib/internal/debugger/inspect.js 93.29% <62.50%> (-0.71%) ⬇️
lib/internal/debugger/inspect_probe.js 83.70% <76.92%> (+0.73%) ⬆️

... and 77 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung
joyeecheung force-pushed the probe-attach-7 branch from db767cb to c2881e9 Compare November 3, 2026 17:13
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@joyeecheung
joyeecheung force-pushed the probe-attach-7 branch from c2881e9 to 4946758 Compare November 4, 2026 16:20
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@joyeecheung
joyeecheung force-pushed the probe-attach-7 branch from 4946758 to 55e1f4e Compare November 5, 2026 15:05
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@joyeecheung
inspector: support attaching to a running process in probe mode
1a908f7
Probe mode currently only launches a new process from the entry point
script. This change lets it attach to an already-running process, so a
long-lived application can be inspected without restarting it.

Running `node inspect --probe` without specifying an entry point script
instructs Node.js to attach to a running Node.js process and probe.
The way attaching is done is specified through command line arguments:

- `--pid <pid>` activates the target's inspector (if it's not already
  activated) and connects to it.
- `--host <host>` and `--port <port>` specify an address where an
  inspector is listening. The host defaults to 127.0.0.1 and the
  port defaults to 9229.

When the session ends, probe mode resumes and detaches instead of
killing a process it does not own. The report now includes a top-level
`target` field describing what was probed, and each probe contains a
`locations` field about where it bound.

An attach session ends when a probe reaches `--max-hit`
(reported as `completed`), when the target finishes on its
own (`completed`, or `miss` with the pending probes, and the target is
then allowed to exit), or when `--timeout` fires (reported as
`timeout`, the probing process exit with 0 and reports the hits recorded
so far).

`--timeout` now is also applied to the startup phase in both modes, so
a target that never responds before the breakpoints are bound is
reported as an error instead of hanging.

Signed-off-by: Joyee Cheung <[email protected]>
@joyeecheung
joyeecheung force-pushed the probe-attach-7 branch from 55e1f4e to 1a908f7 Compare November 6, 2026 16:20
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@joyeecheung

joyeecheung commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

CI was green. Would you be interested in reviewing this when you have time? @legendecas @hybrist

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hybrist
hybrist approved these changes Nov 9, 2026
View reviewed changes
legendecas
legendecas reviewed Nov 9, 2026
View reviewed changes
Comment thread lib/internal/debugger/inspect_probe.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung @legendecas
fixup! inspector: support attaching to a running process in probe mode
7960569
Co-authored-by: Chengzhong Wu <[email protected]>
legendecas
legendecas approved these changes Nov 10, 2026
View reviewed changes
@legendecas legendecas added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. author ready PRs with CI started, the required approvals, and no outstanding review comments. labels Nov 10, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 10, 2026
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@legendecas legendecas added commit-queue PRs queued for automated landing through the Commit Queue. and removed commit-queue PRs queued for automated landing through the Commit Queue. labels Nov 11, 2026
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 12, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 12, 2026
@github-actions github-actions Bot added the request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. label Nov 12, 2026
@github-actions

This comment was marked as outdated.

Sign in to view
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@nodejs-github-bot

nodejs-github-bot commented Nov 14, 2026 •
edited by jasnell
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/79074/ 💚

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Nov 15, 2026
View reviewed changes
@joyeecheung joyeecheung added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. and removed request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. labels Nov 17, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 1c40cfa into nodejs:main Nov 17, 2026
89 of 90 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Landed in 1c40cfa

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 17, 2026
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
@joyeecheung @aduh95
inspector: support attaching to a running process in probe mode
72859e1
Probe mode currently only launches a new process from the entry point
script. This change lets it attach to an already-running process, so a
long-lived application can be inspected without restarting it.

Running `node inspect --probe` without specifying an entry point script
instructs Node.js to attach to a running Node.js process and probe.
The way attaching is done is specified through command line arguments:

- `--pid <pid>` activates the target's inspector (if it's not already
  activated) and connects to it.
- `--host <host>` and `--port <port>` specify an address where an
  inspector is listening. The host defaults to 127.0.0.1 and the
  port defaults to 9229.

When the session ends, probe mode resumes and detaches instead of
killing a process it does not own. The report now includes a top-level
`target` field describing what was probed, and each probe contains a
`locations` field about where it bound.

An attach session ends when a probe reaches `--max-hit`
(reported as `completed`), when the target finishes on its
own (`completed`, or `miss` with the pending probes, and the target is
then allowed to exit), or when `--timeout` fires (reported as
`timeout`, the probing process exit with 0 and reports the hits recorded
so far).

`--timeout` now is also applied to the startup phase in both modes, so
a target that never responds before the breakpoints are bound is
reported as an error instead of hanging.

Signed-off-by: Joyee Cheung <[email protected]>
PR-URL: #67201
Reviewed-By: Jan Martin <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha) #67757
Merged
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@joyeecheung @gabylb
inspector: support attaching to a running process in probe mode
9ec7c68
Probe mode currently only launches a new process from the entry point
script. This change lets it attach to an already-running process, so a
long-lived application can be inspected without restarting it.

Running `node inspect --probe` without specifying an entry point script
instructs Node.js to attach to a running Node.js process and probe.
The way attaching is done is specified through command line arguments:

- `--pid <pid>` activates the target's inspector (if it's not already
  activated) and connects to it.
- `--host <host>` and `--port <port>` specify an address where an
  inspector is listening. The host defaults to 127.0.0.1 and the
  port defaults to 9229.

When the session ends, probe mode resumes and detaches instead of
killing a process it does not own. The report now includes a top-level
`target` field describing what was probed, and each probe contains a
`locations` field about where it bound.

An attach session ends when a probe reaches `--max-hit`
(reported as `completed`), when the target finishes on its
own (`completed`, or `miss` with the pending probes, and the target is
then allowed to exit), or when `--timeout` fires (reported as
`timeout`, the probing process exit with 0 and reports the hits recorded
so far).

`--timeout` now is also applied to the startup phase in both modes, so
a target that never responds before the breakpoints are bound is
reported as an error instead of hanging.

Signed-off-by: Joyee Cheung <[email protected]>
PR-URL: nodejs#67201
Reviewed-By: Jan Martin <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@hybrist hybrist hybrist approved these changes
@legendecas legendecas legendecas approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. debugger Issues and PRs related to the Node.js command-line debugger. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@joyeecheung @nodejs-github-bot @jasnell @hybrist @legendecas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.