Current recommended way to deal with restarted Streamlit sessions, for both recovering the session state and continuing calculations
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
No files, tests, or entry points are named. Start by reviewing Streamlit's session-state behavior and the existing discussion, then separate the requested recovery of state from persistence of long-running jobs. Done would require a clearly scoped, supported approach for both restart scenarios, including behavior for large in-memory data and ongoing computations.
Written by the indexing model from the issue text.
Description
Checklist
- I have searched the existing issues for similar feature requests.
- I added a descriptive title and summary to this issue.
Summary
Background:
Unfortunately the platform where we are primarily deploying Streamlit, Palantir Foundry Code Workspaces, randomly restarts Streamlit sessions. It seems they are unable or unwilling to fix this, which is probably the right way to solve the problem, but I am posting here in case others have similar issues, as this could be a more general topic.
If you run a Jupyter notebook in say JupyterLab and then restart the browser, you see in the console that Jupyter reconnects to the session and everything is preserved nicely.
However, we all know that when Streamlit is restarted (and I personally think Streamlit could be utilized as a more user-friendly Jupyter notebook), nothing is preserved.
We have partially combatted the problem by allowing the user to manually save the session state, but if our users forget, then their work since their last save is lost. Note a consideration at least in our case is that we are performing sometimes complex analyses on large datasets, so at times we have 10-15 GB of data in the session state and are running hours-long computations using multiple cores. Each manual save can therefore take a significant amount of time (~a minute).
Questions:
- What is Streamlit's current recommended way to continuously save the session state so that if the session is randomly restarted, all is recovered. This has to be a fast process since again we often have large datasets in memory.
- What is Streamlit's current recommended way to persist jobs being run by Streamlit instead of them getting killed if the session is restarted?
Thanks so much in advance for your help!
Why?
No response
How?
No response
Additional Context
No response
- Dominant language
- Python
- Stars
- 45.8k
- Forks
- 4.4k
- Avg merge
- 21h 22m
- Merged PRs (30d)
- 316
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from streamlit/streamlit
-
area:backend area:network feature:embedding feature:runtime priority:P3 status:confirmed type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:frontend area:security feature:st.file_uploader status:unlikely type:enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area:backend area:security feature:cache feature:cache-hash-func priority:P4 status:confirmed type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:mobile feature:st.camera_input papercut type:enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:ai type:enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
All issues in streamlit/streamlit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100