I'm debugging vscode using the Debug VS Code Main, Renderer & Extension Host launch config. When I stop debugging (using the stop button), the debug toolbar ends up like below and won't go away. And I can't start another debugging session -- I have to restart vscode.
Here is what I see in the devtools too:
Could not connect to debug target at http://localhost:5870: Cancelled GET http://localhost:5870/json/version: timeout after 10000ms
onDidChangeNotification @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:2892
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:4092 Extension Host
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:4092 ERROR: The process with PID 22732 (child process of PID 22656) could not be terminated.
Reason: There is no running instance of the task.
3/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:2892 Could not connect to debug target at http://localhost:5870: Cancelled GET http://localhost:5870/json/version: timeout after 10000ms
onDidChangeNotification @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:2892
12/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1683 ERR TreeError [CallStackView] Data tree node not found: [object Object]: Error: TreeError [CallStackView] Data tree node not found: [object Object]
at e.getDataNode (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1118:66)
at expand (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1116:206)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6083:49
at Set.forEach (<anonymous>)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6083:28
10/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1683 ERR TreeError [CallStackView] Data tree node not found: [object Object]: Error: TreeError [CallStackView] Data tree node not found: [object Object]
at e.getDataNode (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1118:66)
at expand (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1116:206)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6083:49
at Set.forEach (<anonymous>)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6083:28
2/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1683 ERR no debug adapter: Error: no debug adapter
at e.terminate (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6154:20)
at e.stopSession (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6181:458)
at handler (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6075:51)
at d.invokeFunction (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1664:794)
at e._tryExecuteCommand (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:3559:844)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:3559:578
at async run (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:140:287)
4/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
t.log @ /C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261
2/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1683 ERR no debug adapter: Error: no debug adapter
at e.terminate (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6154:20)
at e.stopSession (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6181:458)
at handler (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:6075:51)
at d.invokeFunction (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1664:794)
at e._tryExecuteCommand (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:3559:844)
at file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:3559:578
at async run (file:///C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:140:287)
3/C:/Users/Eric/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:261 [Extension Host] Writing to a closed connection (at t.StreamDapTransport.send (c:\Users\Eric\.vscode-insiders\extensions\ms-vscode.js-debug-nightly-2020.3.917\src\extension.js:68:157578))
A few errors here... I see some coming up from vscode core. Wonder if those are leading to the incomplete teardown state, cc @isidorn It does look like the DAP sessions were torn down gracefully from what I can see in the logs.
The "writing to closed connection" happens often during pwa teardown, but should not cause any negative effects. Just means there were some async processes ongoing in the midst of disconnection, which is normal.
I think the "ERR no debug adapter: Error: no debug adapter" is a result of the previous timeout in attachment.
@connor4312 No debug adapter means that vs code tried to send some requests but the debug adapter went down in the meantime. It is coming from ths file
I am not a fan of those errors as they should at least report what request was being sent.
I have improved that via https://github.com/microsoft/vscode/commit/d2d9498c730482bfbabbf466c428b5ebc1be6855
So hopefully from tomorrow's vscode insiders we will have more preceise errors.
fyi @weinand
@isidorn We've already decided to suppress errors after the DA has terminated. As Connor has pointed out: these errors are expected and there is no need to bother the user with them.
Ugh, this is happening to me almost constantly lately when debugging vscode. I've resorted to running my watch task outside vscode, because every time I end a debug session I have to restart vscode before I can start debugging again.
The issue was this:
(the "retry forever" behavior is probably good in general because it gives the caller control over when they want to give up, they can kill the watchdog at that point, and in top-level sessions this is what happens...)
attachToTarget to return an empty response. However, we didn't check that it was actually successful before continuing to attach. This eventually causes us to yield back to the launch request and say we 'sucessfully' launched a child session after its parent terminated. So this returns...I'll fix 1-3 in here, and open an issue in vscode for 3-5.
To verify: reliable repro for me was running "Debug VS Code Main, Renderer & Extension Host", then selecting the extension host in the call stack view and using the disconnect action in the debug toolbar to stop the session. Then after stopping the other two sessions the debug toolbar should disappear and you should be able to restart debugging as usual.