Skip to content

Commit 60a0764

Browse files
committed
debugger: fix race condition/deadlock on initialization
PR-URL: nodejs#38161 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]>
1 parent 0955aae commit 60a0764

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

lib/internal/inspector/inspect_repl.js

+10-13
Original file line numberDiff line numberDiff line change
@@ -1062,19 +1062,16 @@ function createRepl(inspector) {
10621062
}
10631063

10641064
function initAfterStart() {
1065-
const setupTasks = [
1066-
Runtime.enable(),
1067-
Profiler.enable(),
1068-
Profiler.setSamplingInterval({ interval: 100 }),
1069-
Debugger.enable(),
1070-
Debugger.setPauseOnExceptions({ state: 'none' }),
1071-
Debugger.setAsyncCallStackDepth({ maxDepth: 0 }),
1072-
Debugger.setBlackboxPatterns({ patterns: [] }),
1073-
Debugger.setPauseOnExceptions({ state: pauseOnExceptionState }),
1074-
restoreBreakpoints(),
1075-
Runtime.runIfWaitingForDebugger(),
1076-
];
1077-
return Promise.all(setupTasks);
1065+
return Runtime.enable()
1066+
.then(() => Profiler.enable())
1067+
.then(() => Profiler.setSamplingInterval({ interval: 100 }))
1068+
.then(() => Debugger.enable())
1069+
.then(() => Debugger.setPauseOnExceptions({ state: 'none' }))
1070+
.then(() => Debugger.setAsyncCallStackDepth({ maxDepth: 0 }))
1071+
.then(() => Debugger.setBlackboxPatterns({ patterns: [] }))
1072+
.then(() => Debugger.setPauseOnExceptions({ state: pauseOnExceptionState }))
1073+
.then(() => restoreBreakpoints())
1074+
.then(() => Runtime.runIfWaitingForDebugger())
10781075
}
10791076

10801077
return function startRepl() {

0 commit comments

Comments
 (0)