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

Reloading with busy runtime looks frozen, breaks LSP #1243

Closed
Tracked by #1617
jmcphers opened this issue Sep 5, 2023 · 6 comments
Closed
Tracked by #1617

Reloading with busy runtime looks frozen, breaks LSP #1243

jmcphers opened this issue Sep 5, 2023 · 6 comments
Assignees
Labels
area: workbench Issues related to Workbench category. bug Something isn't working lang: r sharp-edge

Comments

@jmcphers
Copy link
Collaborator

jmcphers commented Sep 5, 2023

To reproduce:

  1. Start R
  2. Run Sys.sleep(60) or another long-running command
  3. Reload the Positron window (Cmd+R or Reload Window)
  4. Attempt to run another R command

It looks like you can run another R command, but you can't. The runtime appears to be frozen.

Screen.Recording.2023-09-05.at.3.51.32.PM.mov

Shortly after reload, the LSP also fails to start:

image

The source of both of these problems is that Positron is trying to reconnect to a runtime that is busy running code, but Positron doesn't know it's busy running code. Consequently we don't show any busy UI, we offer an input prompt, and we try to start the LSP (which is not something you can do during a computation, at least not in R).

The right solution to this probably requires an intermediary layer (as in #1155), but perhaps as a stopgap we can implement it directly in the language packs in some way.

@seeM
Copy link
Contributor

seeM commented Sep 6, 2023

I see exactly the same behaviour in Python

@jmcphers
Copy link
Collaborator Author

This is necessary for Posit Workbench support; without it, if you close the browser while a computation is running and later reconnect, Python/R will be frozen until the computation is completed. This is very undesirable.

@jmcphers
Copy link
Collaborator Author

jmcphers commented Oct 1, 2024

I have a change on a branch that addresses this using the new Jupyter kernel supervisor.

@jmcphers
Copy link
Collaborator Author

jmcphers commented Oct 8, 2024

Update: In my testing this works OK for Python. R is better -- it does wait to reattach the LSP until R isn't busy -- but when it does reattach the LSP it crashes ark. This may be an ark bug or may be an ordering issue we can/should resolve on the Positron side.

@jmcphers jmcphers self-assigned this Oct 8, 2024
@jmcphers
Copy link
Collaborator Author

jmcphers commented Oct 9, 2024

Ready to verify for Python; I'll open a separate bug for R as noted above. Note that you'll need to enable the new supervisor to verify!

@jonvanausdeln
Copy link
Contributor

With the new supervisor enabled, it now waits for the running command to finish, and pops a toast message .

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: workbench Issues related to Workbench category. bug Something isn't working lang: r sharp-edge
Projects
None yet
Development

No branches or pull requests

7 participants