-
Notifications
You must be signed in to change notification settings - Fork 3k
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
streamlit does not produce WebSocket ping frames #8660
Comments
I'm wondering if this is a upstream bug in Tornado. I did a TCP dump of the traffic locally where the websocket connection was established via curl, and indeed there is ping traffic being generated: But the strange thing is that it terminates the connection after 30s, which seems to be a bug in tornado then. Looking upstream, there seems to be one PR tornadoweb/tornado#3376 that attempts to solve this. I tested with the changes suggested in the PR, and this changes the traffic flow to this: This works, but for some reason the ping comes at interval of 30s. I think this is related to the PR in question (logic error?) |
Thanks for reporting this @toredash! Do you happen to remember the last streamlit version where you didn't observe this issue? Anecdotally, I remember inspecting network traffic and seeing websocket pings from tornado to the streamlit client at some point in the past, so there's a chance this is indeed an upstream tornado bug given that I don't think the code for this on our end has changed for quite some time (it has probably been months to years since the code related to this has been changed significantly). |
@vdonato I made the assumption that this was a regression, but it seems this problem has been present in earlier builds of streamlit as well. My bad, I've removed that tick. I noticed the same, that the streamlit code on this area has been stable for some time. For whats it worth, it seems that tornadoweb/tornado#3376 is solving the issue of tornado closing the ws connection prematurely, but with the logic error. |
Checklist
Summary
streamlit is supposed to generate WebSocket ping to ensure that the connection to the end-user is not terminated by any proxy sitting between the user and streamlit
Reproducible Code Example
No response
Steps To Reproduce
ENTRYPOINT ["streamlit", "hello"]
Expected Behavior
In
server.py
, there is TORNADO_SETTINGS (streamlit/lib/streamlit/web/server/server.py
Lines 61 to 74 in 406b1e6
Since this function does not currently work (tested in 1.34.0 of streamlit), deploying streamlit in any environment can cause connectivity issues, unless the developer writes their own ping logic into streamlit.
Current Behavior
No WebSocket ping messages is sent, code suggests it should be sent.
Is this a regression?
Debug info
Additional Information
I'm assuming this is a regression or upstream bug as a result of library update.
I've found similar issues and code changes related to this:
#3464
https://discuss.streamlit.io/t/websocketconnection-websocket-onerror/46298/10
The text was updated successfully, but these errors were encountered: