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

Simplify logic for switching runtimes for a notebook #5558

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

seeM
Copy link
Contributor

@seeM seeM commented Nov 28, 2024

A little refactor to simplify the logic for switching runtimes for a notebook.

When a user switches from one Positron notebook controller to another, two events are fired: one with selected === true and one with selected === false. The order of those events is not guaranteed, so we have to be careful about the order we request to shutdown the previous runtime and start the new one.

We previously worked around that by retrying the start request, but it's much simpler to shutdown any existing runtimes in the selected === true case.

QA Notes

In a notebook, if you change the selected runtime a bunch of times you should be able to execute code in any selected runtime and there should not be any error notifications or console logs.

@seeM seeM requested a review from nstrayer November 28, 2024 13:06
Copy link
Contributor

@nstrayer nstrayer left a comment

Choose a reason for hiding this comment

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

Oh this one is way nicer and more robust! Always good to get rid of sleeps and retries!

@seeM seeM merged commit 506c21a into main Dec 4, 2024
4 checks passed
@seeM seeM deleted the simplify-switching-notebook-controllers branch December 4, 2024 07:08
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2024
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.

2 participants