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

Shutdown reticulate finalizer #603

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

dfalbel
Copy link
Contributor

@dfalbel dfalbel commented Oct 22, 2024

Make sure that exiting the R session will first finalize the reticulate Python session.
See posit-dev/positron#5100 for more details.

@lionel-
Copy link
Contributor

lionel- commented Oct 24, 2024

I would avoid using finalizers for this, and also blocking in the finalizer.

Could we shut it down from the positron side via comm msg?
If not, do it from Ark's shutdown message handler, perhaps with some new handler mechanism that comms could register.

@dfalbel
Copy link
Contributor Author

dfalbel commented Oct 24, 2024

I'm not really happy with this approach either.

I couldn't find a way to do this from Positron, ideally we need some syncronous callback that is called before the R session exits. Currently positron doesn't have any API that let's us know when the session is about to close.
I briefly talked with @jmcphers about having such callbacks but it seems like a good ammount of work to implement it properly in the Positron side.

I can try attaching attaching this to the Ark shutdown handler, which makes things much more predictable. Although I hope this code is transient and just sits there while we don't have the nice solution implemented in Positron.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants