Skip to content

debugger: wait for initial break render during startup#64189

Open
inoway46 wants to merge 1 commit into
nodejs:mainfrom
inoway46:debugger-initial-break-render-wait
Open

debugger: wait for initial break render during startup#64189
inoway46 wants to merge 1 commit into
nodejs:mainfrom
inoway46:debugger-initial-break-render-wait

Conversation

@inoway46

@inoway46 inoway46 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

node inspect <script> startup could display the debug> prompt before the initial break output had been rendered.
ex. https://github.com/nodejs/node/actions/runs/28076627608

This updates initial local script startup to wait for the first Debugger.paused render before creating the REPL prompt, preserving the expected startup output order:

Debugger attached.
 ok
Break on start in ...
debug>

This wait only applies to initial local script startup and is released on startup exceptions, client close, or child exit. Other debugger flows are unchanged.

Testing

ninja -C out/Release node
./tools/test.py -p actions parallel/test-debugger-run-restart-init
./tools/test.py -p actions parallel/test-debugger-help
./tools/test.py -p actions sequential/test-debug-prompt
./tools/test.py -p actions parallel/test-debugger-restart-message
./tools/test.py -p actions parallel/test-debugger-exceptions parallel/test-debugger-run-after-quit-restart
VERBOSE=1 out/Release/node test/parallel/test-debugger-auto-resume.mjs

@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 Jun 28, 2026
@inoway46 inoway46 marked this pull request as ready for review June 28, 2026 11:16
@inoway46 inoway46 force-pushed the debugger-initial-break-render-wait branch 2 times, most recently from 065ef9a to 7ffd297 Compare June 28, 2026 12:44
Comment on lines +975 to +981
// Startup can fail before the initial pause is reported, so release the
// startup wait instead of blocking the REPL prompt indefinitely.
Runtime.on('exceptionThrown', () => {
if (waitForInitialBreakRender && initialBreakRender) {
finishInitialBreakRenderWait(initialBreakRender);
}
});

@inoway46 inoway46 Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This keeps sequential/test-debug-prompt from hanging when node inspect foo fails before the initial Debugger.paused render and the REPL would otherwise never reach debug>.

failed log: https://github.com/nodejs/node/actions/runs/28320440600/job/83901478505?pr=64189#step:8:6114

@inoway46 inoway46 marked this pull request as draft June 28, 2026 15:06
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
@inoway46 inoway46 force-pushed the debugger-initial-break-render-wait branch from 7ffd297 to 9968df6 Compare June 28, 2026 15:15
@inoway46 inoway46 marked this pull request as ready for review June 28, 2026 15:38
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