Description
Updates
- Issue where the websocket connection is closed before it is succseefully opened.
- Observed in Firefox, Edge and Chrome so far with the following messages:
- WebSocket connection to '' failed: WebSocket is closed before the connection is established.
- Firefox can’t establish a connection to the server at ws://.
- Observed on Linux and Windows.
- The websocket gets closed with error code 1006 and a blank reason. This is the same result as killing the UIS.
- There is a related timeout issue which can present similarly, add debugging into the subscriptions-transport-ws code to tell the difference.
- These failed requests do not reach the Tornado websocket implementation.
OP
Sometimes it takes a long time for the UI to connect with the backend.
It seems to get there in the end but it often takes in excess of 45 seconds to establish the subscription connection. The issue occurs randomly when the page is loaded and causes the no-connection error box hangs around.
Whilst we are waiting for the connection this message appears multiple times (Firefox):
Firefox can’t establish a connection to the server at ws://localhost:8888/cylc/subscriptions.
Which suggests multiple failed attempts at connection, however, after jamming some logging into the UIS (backend server) I can see no evidence of connection attempts (at least none which actually get into the websocket code). The UIS responds quickly once it receives the request.
It's not clear what's causing this, however, it is worth noting that we are using a deprecated framework for subscriptions, we should try moving to something more modern and see if the problem goes away by itself - #1028.