Skip to content
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

config: configure default websocket ping interval #586

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changes.d/586.feat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The UI Server is now configured to regularly ping active clients to ensure they
are alive. This helps the server to detect closed connections sooner, it also
ensures that open connections do not appear idle to proxy servers which are
sometimes configured to kill websockets after a period of inactivity.
You can override or modify this behaviour in your jupyter configuration using
the `websocket_ping_interval` and `websocket_ping_timeout` configurations, see
the Jupyter Server reference for more information.
4 changes: 4 additions & 0 deletions cylc/uiserver/jupyter_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
)
]

# configure websocket pings (helps to detect client-closed connections)
c.ServerApp.websocket_ping_interval = 10
c.ServerApp.websocket_ping_timeout = 10

# store JupyterHub runtime files in the user config directory
USER_CONF_ROOT.mkdir(parents=True, exist_ok=True)
c.JupyterHub.cookie_secret_file = f'{USER_CONF_ROOT / "cookie_secret"}'
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ install_requires =
graphene
graphene-tornado==2.6.*
graphql-ws==0.4.4
jupyter_server>=2.7
jupyter_server>=2.13.0
requests
psutil
tornado>=6.1.0 # matches jupyter_server value
Expand Down