Theia: Firefox debugger stays in 'debug' state if debugged window is closed or attach is cancelled

Created on 7 Apr 2020  路  7Comments  路  Source: eclipse-theia/theia

Description

When I close debugged Firefox window, debugging session in Theia remains open until Theia reload.

Reproduction Steps

  1. Install Firefox Debugger extension, I did it from .vsix I had (v2.7.0)
  2. Start debug using either launch or attach
  3. Close debugged window or press cancel in attach window
  4. See that bottom pane is still orange and debug view shows there's a session running
    If you stop session using button in Theia debugger disconnects from Firefox correctly.
    VS Code debug session with v2.7.1 of extension ends successfully when closing the browser. It doesn't look like the bug was fixed, code stayed almost the same: https://github.com/firefox-devtools/vscode-firefox-debug/compare/2.7.0...2.7.1 .
    Chrome Debugger works just fine and stops the session after Chrome is stopped.

OS and Theia version:
Ubuntu 19.10, Theia 1.0.0

Diagnostics:
Hmm, this may be related:

Error: the debug session connection is disposed, id: 99f3c7c4-6450-4881-87a7-d33c486a9f99 debug-session-connection.ts:129:18
bug debug help wanted

All 7 comments

This may relate too: if I reload Theia without ending the debug session, debugged browser (launch option) is still open, but debug session in Theia is closed. I think it should restore that session, or, at least, gracefully end it, not leaving processes running after user has left. Maybe this is another issue, ping me if it should be reported separately.

This may relate too: if I reload Theia without ending the debug session, debugged browser (launch option) is still open, but debug session in Theia is closed. I think it should restore that session, or, at least, gracefully end it, not leaving processes running after user has left. Maybe this is another issue, ping me if it should be reported separately.

Currently it is expected that the debug session should be terminated, but we should not leave orphan processes if they were started not by a user, but the debut adapter.

We have an issue to support shared debug sessions: https://github.com/eclipse-theia/theia/issues/3361 It would allow to preserve debug sessions between page reloads as well. Please upvote there for a feature request.

@akosyakov probably processes can be killed until #3361 is implemented. Then they'll be shared. What do you think about this idea?

@sh7dm We are already killing the entire process tree. I will need to debug to understand why this process cannot be killed.

Killing happens here: https://github.com/eclipse-theia/theia/blob/14531578a1eac6af55c6177ea857d39c38c9f09b/packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts#L122 There are docs how to debug Theia if someone wants to investigate: https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#debugging

Same bug occurs when the attach request if declined

Same bug occurs when the attach request if declined

The are 2 modes of debugging: launch and attach. For launch mode the debug adapter is responsible to start a program on user behalf and terminate it. But for attach a user is responsible for it, i.e. when the session is ended it is expected that a user program is still running.

But someone should try to reproduce to understand which process do you mean hanging. If it is not a user program, but debug adapter, then it is a bug.

Chrome Devtools extension doesn't do so. When I close Chrome, the session is stopped.

Was this page helpful?
0 / 5 - 0 ratings