Skip to content

ark: Cryptic warning after starting and interrupting Shiny application #431

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

Closed
kevinushey opened this issue Apr 12, 2023 · 6 comments
Closed
Milestone

Comments

@kevinushey
Copy link
Contributor

kevinushey commented Apr 12, 2023

Saw this in the console some time after a Shiny application was stopped:

Can't detect correct thread for auto_deleter_background.

Screenshot 2023-04-12 at 1 58 12 PM

It looks like this comes from httpuv; e.g.

https://github.com/rstudio/httpuv/blob/main/src/auto_deleter.h#L30

And the error seems to imply the destructor / deleter was run on a thread unrecognized by later.

For reference, the example code:

shiny::runExample("01_hello")
@kevinushey
Copy link
Contributor Author

Putting this in private alpha in case this is indicative of a need to restructure how threads are oriented in ark.

@kevinushey
Copy link
Contributor Author

Looks like this happens if the LSP thread runs some R code, and that triggers some finalizers registered via httpuv to run.

Screenshot 2023-04-24 at 1 58 16 PM

However, httpuv expects to either be on the "main" thread, or on its own background thread, as per:

https://github.com/rstudio/httpuv/blob/main/src/auto_deleter.h#L13-L51

https://github.com/rstudio/httpuv/blob/main/src/thread.cpp

@ryjohnson09
Copy link

I hit this same issue today. It's hard to replicate - but with enough runApp() calls followed by closing the app, I can usually get the message to appear.

Screenshot 2023-09-22 at 3 17 43 PM

Positron Version: 2023.09.0 (Universal) build 203
Code - OSS Version: 1.79.0
Commit: 519fbc7
Date: 2023-09-22T02:37:21.484Z
Electron: 22.3.10
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.6.0

@lionel-
Copy link
Contributor

lionel- commented Oct 13, 2023

Addressed by posit-dev/ark#109 and ready for review.

Should be fixed in builds >= 2023.10.0-1267.
Could you please confirm this is fixed @ryjohnson09?

@juliasilge
Copy link
Contributor

I just tried running and interrupting Shiny apps many, many times in build 1269 and I never saw "Can't detect correct thread for auto_deleter_background." Working great for me. 👍

@ryjohnson09
Copy link

Addressed by posit-dev/amalthea#109 and ready for review.

Should be fixed in builds >= 2023.10.0-1267. Could you please confirm this is fixed @ryjohnson09?

Confirmed - thanks!!

wesm pushed a commit that referenced this issue Mar 28, 2024
…pstream; fix ruff ignores

Merge pull request #431 from posit-dev/ci-fixes

downgrade pyright to match upstream; fix ruff ignores
--------------------
Commit message for posit-dev/positron-python@1a45ab6:

downgrade pyright to match upstream; fix ruff ignores


Authored-by: Pete Farland <[email protected]>
Signed-off-by: Wasim Lorgat <[email protected]>
wesm pushed a commit that referenced this issue Mar 28, 2024
…pstream; fix ruff ignores

Merge pull request #431 from posit-dev/ci-fixes

downgrade pyright to match upstream; fix ruff ignores
--------------------
Commit message for posit-dev/positron-python@1a45ab6:

downgrade pyright to match upstream; fix ruff ignores


Authored-by: Pete Farland <[email protected]>
Signed-off-by: Wasim Lorgat <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 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

No branches or pull requests

4 participants