-
Notifications
You must be signed in to change notification settings - Fork 4k
[feat] Add configurable websocket ping interval to fix proxy connection drops #12117
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
[feat] Add configurable websocket ping interval to fix proxy connection drops #12117
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
✅ PR preview is ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new configurable option server.websocketPingInterval to allow users to customize the websocket ping interval in Streamlit. This addresses connection drop issues experienced by users with certain proxy setups after upgrading to Streamlit 1.47.0 (which includes Tornado 6.5.1).
Key changes:
- Added new configuration option
server.websocketPingIntervalwith appropriate documentation and validation - Refactored hardcoded
TORNADO_SETTINGSinto dynamicget_tornado_settings()function that respects the new configuration - Added comprehensive test coverage for all scenarios including version-specific behavior
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
lib/streamlit/config.py |
Adds the new server.websocketPingInterval configuration option with detailed documentation |
lib/streamlit/web/server/server.py |
Refactors tornado settings from static dict to dynamic function, implements ping interval logic with version-aware defaults |
lib/tests/streamlit/config_test.py |
Updates test to include the new config option in the expected list |
lib/tests/streamlit/web/server/server_test.py |
Adds comprehensive test coverage for the new functionality including default behavior, custom configuration, and version-specific constraints |
Comments suppressed due to low confidence (1)
lib/streamlit/web/server/server.py:79
- The URL reference points to a specific GitHub comment that may not exist or be accessible. Consider using a more general documentation link or the main pull request URL.
"https://github.com/tornadoweb/tornado/pull/3376#issuecomment-2984887076 "
lukasmasuch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
…on drops (#12117) ## Describe your changes <!-- If it's a visual change, please include a screenshot or video! --> Added a new configuration option `server.websocketPingInterval` to allow users to customize the websocket ping interval. This addresses connection drops experienced by users with certain proxy setups after upgrading to Streamlit `1.47.0` (which includes Tornado 6.5.1). ## GitHub Issue Link (if applicable) Fixes #12108 ## Testing Plan - Added unit tests covering all scenarios: - Default behavior for both Tornado versions - Custom configuration behavior - Version-specific constraints using mocking - All existing tests pass - Linting checks pass --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Describe your changes
Added a new configuration option
server.websocketPingIntervalto allow users to customize the websocket ping interval. This addresses connection drops experienced by users with certain proxy setups after upgrading to Streamlit1.47.0(which includes Tornado 6.5.1).GitHub Issue Link (if applicable)
Fixes #12108
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.