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.

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