Frustrated: Streamlit frontend disconnects from apps with long-running processes

Hello, I am new to the Streamlit community, and I was trying to make my first app. I have a similar problem as those in the thread, but for some reason, using streamlit==0.84.0 does not solve the issue. I am trying to build an app which can take in and process a list of genes. (This process takes a long time because the number of genes in my list can be in the several of thousands.) I suspect that there may be some timeout issue, and I have tried the suggested solutions, but the issue persists. The program gets through about ~1000 iterations on the list and then the page suddenly seems to refresh, as if I had never started running the program. I see no error message, though sometimes, I see a “Page not found” popup on the site. If I run this program on my local machine, it runs completely without issues. If I run this program with a smaller list (i.e. 100 items) hosted on either share.streamlit.io or Heroku, it runs without issues. Does anyone have any suggestions to solve this issue? I appreciate any help, and thank you in advance!

I just wanted to send an update on my issue: I was able to resolve my problem by using a Python subprocess and calling an external Python file to run the rest of the long process. I also made it so that the results from the program are sent by email to the user, so I can close the window after starting execution. However, I still think this might be a workaround solution, so I am open to any ideas others may have. Thank you once again in advance!

Hi,

I have had a similar issue to @Kladar where a session on client side was getting disconnected when some long backend processing (data file loading and processing) was happening, causing the loss of session states the app is using.
I was able to fix it by updating the “websocket_ping_timeout” in that same Streamlit’s sever/server.py file, from 30 to 60 seconds.
However, that means we need to update that value anytime we update the Streamlit version.

Is there any way that could be controlled from a Streamlit setting in the app code?

Or update that value from 30 to 60 sec permanently
?

Hello, i have this kind of problem after deployment. I thought it’s all goods. My python is a long process app. In 300secs it didn’t return a request it will restart yhe web and forcing thr use to start again.