-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to leave kernel sessions running when Positron is closed (#…
…5899) This change makes it possible to close Positron but leave Python or R running, to be resumed/reconnected when Positron is opened again. A new setting controls this behavior; it lets you specify how long to let sessions run idle in the background before they are automatically closed. <img width="734" alt="image" src="https://github.com/user-attachments/assets/88b1dce9-fdfd-4cef-949e-1244c2ba94ea" /> - Enables long-running remote kernels that can be accessed over SSH - For advanced users, enables faster startup and the ability to safely close Positron Desktop without losing data or interrupting computations - Addresses an issue with accumulated orphaned supervisor process observed in some dev environments; these processes will now clean themselves up after an hour - Enables testing of various "leave and come back later" scenarios on Positron Desktop that could formerly only be tested in server and/or Workbench configurations ### How it Works 1. When sessions are not specified to be closed when Positron is closed, the kernel supervisor is: 1. started with a new `--idle-shutdown-hours` flag so that it shuts down on its own after all sessions have been idle for the specified number of hours 2. started with `nohup` (Unix-alike) or `start /b` (Windows) so that it continues running outside the terminal host after Positron closes 2. Persistent sessions are given a new `SessionLocation`: `Machine` 3. Positron saves information about persistent sessions to durable workspace storage rather than ephemeral storage 4. At startup, Positron checks all the persistent sessions to see if they are still valid (i.e. are still running). It reconnects to any that are, in the same way that it would reconnect to a session after a reload. Note that all of this new behavior is opt-in; if the setting is left at its default, Positron behaves the same way it does today. ### Release Notes #### New Features - Option to leave Python or R running when Positron is closed, for remote sessions or long-running computations (#4996) #### Bug Fixes - N/A ### QA Notes - This change should not impact anything when the new setting is left at its default value. - If the kernel session exits while Positron is closed, Positron should not barf when it is reopened; instead, it should just start a new kernel session. - You really do need a full Positron restart when turning this setting on. Once on, you will find that Positron continues to connect to the persistent sessions until they time out or exited, even after turning the setting off, since the setting only applies to new sessions created in the new Positron window after changing the setting. - Some test speedup may be possible with this setting since it lets you repeatedly open and close Positron without waiting for runtime startup. (The downside, of course, is that subsequent opens aren't starting with a clean slate, which may or may not be important). - On Remote SSH, sessions will only persist when started inside a folder/workspace as the blank/empty workspace is effectively re-created every time you use it. --------- Signed-off-by: Jonathan <[email protected]> Co-authored-by: sharon <[email protected]>
- Loading branch information
1 parent
11d5ddf
commit 968a8ac
Showing
21 changed files
with
497 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.