Skip to content
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

Psuedo targets are added to the "Select Debug Console" dropdown when an attached JS target is restarted #173993

Closed
metalmarker opened this issue Feb 9, 2023 · 7 comments · Fixed by #178607
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues debug-console verified Verification succeeded
Milestone

Comments

@metalmarker
Copy link

metalmarker commented Feb 9, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.75.1
  • OS Version: MacOS Ventura 13.2 (22D49)

I'm using VS Code to debug an attached Node app. The problem is that each time that I restart the Node app, new pseudo targets are added to the "Select Debug Console" dropdown of the debug console.

Problem started in 1.75.0. In prior versions, only the "Server" target would appear after restarts (I'm debugging in multiple target environment, so the dropdown is always visible). Since 1.75.0 (and .1), two new targets are added to this list (webpack + server.bundle.js) after each restart. Here's how this dropdown looks like after 3 restarts:

Screenshot 2023-02-09 at 12 39 52 PM

A similar issue happens when attempting to debug a React app - each reattach adds a new pseudo target to the list.

The targets that are added to the debug dropdown are "stale" - switching to one of these pseudo items shows an empty debug console.

Steps to Reproduce:

  1. Start debugging a JS app that is connected via the attach debug mode
  2. Open the debug console
  3. Restart the app using the "restart" icon on the debug panel
  4. Click on the Select Debug Console dropdown, and observe new pseudo targets have been added to the list (and on each subsequent restart)

I tested the same configuration with VSCode 1.74.3, and the problem does not appear.

@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Feb 15, 2023
@roblourens roblourens added this to the Backlog milestone Feb 15, 2023
@roblourens
Copy link
Member

I noticed this, I haven't looked into it at all but wondering whether it's related somehow to #169074 @connor4312

@jpike88
Copy link

jpike88 commented Feb 22, 2023

This is a pain, I often restart my server process and I just see this slowly building list of old server processes. I don't need to keep their logs behind, it just clogs the doprdown.

Screenshot 2023-02-22 at 8 48 24 pm

@jpike88
Copy link

jpike88 commented Feb 22, 2023

ignore my last comment... I found the setting Debug › Console: Close On End was 'off' by default. Turning it on resolved the problem

@connor4312
Copy link
Member

Yea this looks expected since we have a process ID as part of the session name, so they get unique terminals. Could argue we shouldn't... but we do, and I've found it handy on more than one occasion

@metalmarker
Copy link
Author

@connor4312 @jpike88 The problem persists after turning on Debug › Console: Close On End (on version 1.75.1). When the said option is on, the terminal/console pane indeed closes when debug stops, but when I restart the process, the pane re-shows with the "select debug console" dropdown populated with the terminated processes.

In any case, the problem surfaced in 1.75.0 so I still think there's a bug (or undocumented fix) that contributes to this issue. May I suggest to re-open the issue?

@metalmarker
Copy link
Author

metalmarker commented Mar 3, 2023

@connor4312 @roblourens following up - this is still an issue and there's no fix nor a workaround. Can you please re-open the issue so that someone can give it a second look?

@connor4312
Copy link
Member

Yep, thanks for the ping. This was hanging out in my notification queue but forgot to reopen it

@connor4312 connor4312 reopened this Mar 3, 2023
connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Mar 29, 2023
Previously the `Binder` was a little messy. The binder managed the
"tree" of debug sessions, but teardown was not handled in a particular
order. So, for example, when terminating a Node.js session with a bunch
of child processes, the parent process could be terminated and
disconnected while its children were nominally still "running" if their
async shutdown logic didn't finish yet.

Now that things are nicely ordered, I can fix microsoft/vscode#173993
@connor4312 connor4312 self-assigned this Mar 29, 2023
connor4312 added a commit that referenced this issue Mar 29, 2023
If a child session is shut down or shutting down, don't detach it from its parent.

Fixes #173993

Requires microsoft/vscode-js-debug#1619 to work reliably
connor4312 added a commit that referenced this issue Mar 29, 2023
If a child session is shut down or shutting down, don't detach it from its parent.

Fixes #173993

Requires microsoft/vscode-js-debug#1619 to work reliably
trbot86 pushed a commit to trbot86/vscode that referenced this issue Mar 29, 2023
If a child session is shut down or shutting down, don't detach it from its parent.

Fixes microsoft#173993

Requires microsoft/vscode-js-debug#1619 to work reliably
@roblourens roblourens modified the milestones: Backlog, April 2023 Mar 29, 2023
@roblourens roblourens added the verified Verification succeeded label Apr 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues debug-console verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants