bokeh (panel) server running locally via
panel serve server --allow-websocket-origin=127.0.0.1:8080 --keep-alive=3000
Gunicorn+flask app running as separate process (bound to 127.0.01:8080 in the gunicorn_config.py file, omitted for brevity).
gunicorn --config gunicorn.config.py main:app
ISSUE: First and foremost, everything works functionally. Data can be analyzed and visualized per the design. However, scrutiny of the server log messages shows an unexpected websocket transition at client session startup, which I hope to understand if the implications of, if any.
Here’s an excerpt of the relevant portion; those interleaved
_memory_use_cb() lines are from a periodic routine that is in my app code – registered as a on-server-created lifecycle hook and running as a thread.
2021-06-10 16:41:11,624 Receiver created for Protocol() 2021-06-10 16:41:11,624 ProtocolHandler created for Protocol() 2021-06-10 16:41:11,624 ServerConnection created 2021-06-10 16:41:11,626 Sending pull-doc-reply from session 'e0BeBYHOCGafqPalkTYy0SeX5NfKUeh3SKCthhCBOF9i' 2021-06-10 16:41:11,629 WebSocket connection closed: code=1000, reason='closed' 2021-06-10 16:41:12.783 _memory_use_cb() PROFILE [pid:63081] USS 180.093 MB | RSS 286.867 MB
2021-06-10 16:41:13,274 Subprotocol header received 2021-06-10 16:41:13,274 WebSocket connection opened 2021-06-10 16:41:13,275 Receiver created for Protocol() 2021-06-10 16:41:13,275 ProtocolHandler created for Protocol() 2021-06-10 16:41:13,275 ServerConnection created 2021-06-10 16:41:13,276 Sending pull-doc-reply from session 'e0BeBYHOCGafqPalkTYy0SeX5NfKUeh3SKCthhCBOF9i' 2021-06-10 16:41:17.790 _memory_use_cb() PROFILE [pid:63081] USS 183.214 MB | RSS 316.449 MB
2021-06-10 16:41:22,783 [pid 63081] 1 clients connected 2021-06-10 16:41:22,783 [pid 63081] /server has 1 sessions with 0 unused 2021-06-10 16:41:22.799 _memory_use_cb() PROFILE [pid:63081] USS 183.214 MB | RSS 316.449 MB
The thing that raised interest is the “Websocket connection closed: code=1000” entry towards the top of the excerpt. This is then followed by an expected WebSocket connection and ServerConnection.
Any scenario where this makes sense or any reasonable explanation come to mind?
Again, everything works as expected from the user standpoint. Just wanting to button everything up and make sure there are no zombie objects etc. hanging about.