Skip to content

debugger: wait for target startup - #65194

Open
panva wants to merge 1 commit into
nodejs:mainfrom
panva:debugger-startup-handshake
Open

debugger: wait for target startup#65194
panva wants to merge 1 commit into
nodejs:mainfrom
panva:debugger-startup-handshake

Conversation

@panva

@panva panva commented Aug 10, 2026

Copy link
Copy Markdown
Member

Important

This ought to deflake parallel/test-debugger-profile

The inspector can accept a connection before an --inspect-brk target enters its frontend wait. Runtime.runIfWaitingForDebugger can then be handled too early, allowing the target to subsequently block forever.

Wait for NodeRuntime.waitingForDebugger before initializing and releasing launched targets. Race the handshake against disconnects and apply it to both interactive and probe startup.

Refs: #64116
Assisted-by: codex:gpt-5.6-sol

@panva
panva requested a review from joyeecheung August 10, 2026 12:17
@nodejs-github-bot nodejs-github-bot added debugger Issues and PRs related to the debugger subsystem. needs-ci PRs that need a full CI run. labels Aug 10, 2026
The inspector can accept a connection before an --inspect-brk target
enters its frontend wait. Runtime.runIfWaitingForDebugger can then be
handled too early, allowing the target to subsequently block forever.

Wait for NodeRuntime.waitingForDebugger before initializing and
releasing launched targets. Race the handshake against disconnects and
apply it to both interactive and probe startup.

Refs: nodejs#64116
Assisted-by: codex:gpt-5.6-sol
Co-authored-by: Archkon <180910180+Archkon@users.noreply.github.com>
Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
@panva
panva force-pushed the debugger-startup-handshake branch from f206372 to 821e267 Compare August 10, 2026 13:25
@panva

panva commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

The startup-readiness handshake and its initial integration were adapted from @Archkon's work in #64304. This version narrows and hardens that approach by covering disconnects during the full handshake, preserving probe-mode structured errors, and adding focused failure and cleanup tests.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.04478% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.32%. Comparing base (404b0cf) to head (821e267).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/debugger/inspect_probe.js 50.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65194      +/-   ##
==========================================
- Coverage   90.32%   90.32%   -0.01%     
==========================================
  Files         760      760              
  Lines      248525   248590      +65     
  Branches    46894    46909      +15     
==========================================
+ Hits       224488   224534      +46     
- Misses      15469    15472       +3     
- Partials     8568     8584      +16     
Files with missing lines Coverage Δ
lib/internal/debugger/inspect_helpers.js 97.92% <100.00%> (+0.51%) ⬆️
lib/internal/debugger/inspect_repl.js 91.34% <100.00%> (+0.03%) ⬆️
lib/internal/debugger/inspect_probe.js 81.60% <50.00%> (-0.45%) ⬇️

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

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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

Labels

debugger Issues and PRs related to the debugger subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants