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

debug: allow orphans to outlive their parents #169074

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

connor4312
Copy link
Member

Previously, if a parent session was terminated but its children lived on, the UI would get into a broken state. Talking with @roblourens, we should probably support this, and doing so was disturbingly easy...

This PR unsets parentSession on the children when their parent is terminated. Generally session.parentSession was only checked and used synchronously, for example in the debug console switcher command. The area where this wasn't the case was in the REPLs. If a child previously merged its repl with its parent, then we'll clone the parent's repl and detach it into each child; I think keeping them connected would likely be confusing.

The other change I tentatively put forward, is only bubbling restart and stop commands to the parent if session.lifecycleManagedByParent is true. I think this is more 'correct' but may result in surprising behavior for DA's who haven't yet adopted that property (like Python microsoft/vscode-python#20376)

Fixes #130941
Fixes #164553

@connor4312 connor4312 self-assigned this Dec 14, 2022
@VSCodeTriageBot VSCodeTriageBot added this to the January 2023 milestone Dec 14, 2022
Previously, if a parent session was terminated but its children lived on,
the UI would get into a broken state. Talking with @roblourens, we
should probably support this, and doing so was disturbingly easy...

This PR unsets `parentSession` on the children when their parent is
terminated. Generally `session.parentSession` was only checked and used
synchronously, for example in the debug console switcher command. The
area where this wasn't the case was in the REPLs. If a child previously
merged its repl with its parent, then we'll clone the parent's repl
and detach it into each child; I think keeping them connected would
likely be confusing.

The other change I tentatively put forward, is only bubbling restart and
stop commands to the parent if `session.lifecycleManagedByParent` is
true. I think this is more 'correct' but may result in surprising
behavior for DA's who haven't yet adopted that property (like
Python microsoft/vscode-python#20376)

Fixes #130941
Fixes #164553
Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to mention something about lifecycleManagedByParent in the release notes, even if it's just a reminder + announcement that we're now more strict

@connor4312 connor4312 merged commit 812f54b into main Dec 14, 2022
@connor4312 connor4312 deleted the debug/orphan-child-sessions branch December 14, 2022 16:52
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI stuck in debugging Remote debugger won't detach when running uvicorn app with --reload
3 participants