-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension debugging: stopping debug session doesn't close window #126911
Comments
@isidorn thanks for trying this. Since I could reliably reproduce this problem, I tried all kinds of things in order to find the source of the problem: uninstalling all extensions, changing settings, restarting my computer, taking a coffee break.. ;-) What helped in the end was deleting the Then I was looking into the other new issue #126924. And again deleting the So there seems to be an issue with persisted state but I have no idea why that affects the window close on debug session end... |
@weinand if you can reproduce it would be interesting to understand if the signal to close the window is sent or not. I forgot if we send this from the debug session, or from the debug adapter. |
@isidorn no, we don't close EH windows from the debug session. The window is closed because the extension host process is terminated. |
@bpasero before giving up on this issue I would like to get your insights. |
Trying to find that code again, can you point me to it? If you have a reliable repro for this, can you try running with |
Isn't it this code, which would suggest the window is closed based on an event from debug? vscode/src/vs/workbench/services/extensions/electron-browser/localProcessExtensionHost.ts Lines 131 to 135 in d18e54f
//cc @isidorn |
Ah and it seems like also this one: vscode/src/vs/workbench/services/extensions/electron-browser/extensionService.ts Lines 461 to 472 in 2a82df9
|
The latter seems the one that works here, the former seems to be used only in remote extension host scenarios. |
When pressing the Stop button VS Code sends a DAP "disconnect" request to js-debug which in turn terminates the node process (EH). Some workbench code then gets a signal that the node.js child process has died. If this happens as part of a "reload command", a new EH is started and the corresponding window is not closed. Otherwise the window is closed. |
Thanks. So for me it seems like js-debug is not able to terminate the EH. @connor4312 could you double check from the js-debug side if the extension is successful in shutting down the EH. Or if the process is left lying around? fyi @alexdima @roblourens |
I was not able to reproduce even with your user data folder, so I wonder if it is the associated data specifically for the workspace that is being debugged? |
It happens to me after I have done a reload of the debug session.
Note: I'm using Mac OS 11.5 |
@connor4312 above Isi said:
Could you please check in what situations this could happen? |
Sorry I missed this notification. I don't believe js-debug ever terminates the extension host itself; that is normally done by core. Though I could always add code to do so... |
@connor4312 I could not find the code in core that terminates the EH, I thought it was being done by the js-debug. |
Added and it seems to work for me. Mark verified if it does for you too, please 🙂 |
@connor4312 Yes, VS Code core does not do anything special when debug's stop button is pressed for extension debugging. So the Stop button just triggers a regular DAP "disconnect" protocol sequence. |
I have verified that this indeed fixes the issue on my machine with the js-debug-nightly. |
Interesting. No idea how this was working before 😛 |
Good question - I do not have an explanation either... BTW, does js-debug's extension debugging supports DAP's "terminate" request? In that case VS Code will send a "terminate" on first press of the Stop button. Could you please check with Rob what was done in node-debug2. |
Issue Type: Bug
Observe: extension window doesn't close
This problem doesn't occur with a simple "hello world" extension.
VS Code version: Code - Insiders 1.58.0-insider (6afedfd, 2021-06-21T05:14:03.949Z)
OS version: Darwin x64 20.5.0
Restricted Mode: No
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Extensions (25)
A/B Experiments
The text was updated successfully, but these errors were encountered: