Skip to content

Commit

Permalink
debugger: fix race condition/deadlock on initialization
Browse files Browse the repository at this point in the history
PR-URL: nodejs#38161
Backport-PR-URL: nodejs#38858
Refs: nodejs#36481
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Gerhard Stöbich <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
Trott committed May 30, 2021
1 parent e7ef094 commit 9719487
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions lib/internal/inspector/inspect_repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1062,19 +1062,16 @@ function createRepl(inspector) {
}

function initAfterStart() {
const setupTasks = [
Runtime.enable(),
Profiler.enable(),
Profiler.setSamplingInterval({ interval: 100 }),
Debugger.enable(),
Debugger.setPauseOnExceptions({ state: 'none' }),
Debugger.setAsyncCallStackDepth({ maxDepth: 0 }),
Debugger.setBlackboxPatterns({ patterns: [] }),
Debugger.setPauseOnExceptions({ state: pauseOnExceptionState }),
restoreBreakpoints(),
Runtime.runIfWaitingForDebugger(),
];
return Promise.all(setupTasks);
return Runtime.enable()
.then(() => Profiler.enable())
.then(() => Profiler.setSamplingInterval({ interval: 100 }))
.then(() => Debugger.enable())
.then(() => Debugger.setPauseOnExceptions({ state: 'none' }))
.then(() => Debugger.setAsyncCallStackDepth({ maxDepth: 0 }))
.then(() => Debugger.setBlackboxPatterns({ patterns: [] }))
.then(() => Debugger.setPauseOnExceptions({ state: pauseOnExceptionState }))
.then(() => restoreBreakpoints())
.then(() => Runtime.runIfWaitingForDebugger())
}

return function startRepl() {
Expand Down

0 comments on commit 9719487

Please sign in to comment.