Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature+Bugfix: Engine websocket management #360
Many of the websocket improvements I've been making have been for
One of the biggest bugs I introduced was the shutdown channel closure timeout. If
Another issue was that if the websocket was disconnected and failed to reconnect, it would eventually reach a situation where it would just output logs saying that it can't reconnect anymore. The new connection manager will try to reconnect forever unless the websocket is disabled.
More minor things have been cleaned up like the traffic monitor. It doesn't use channels to manage status and doesn't have a flow-on timeout tier of disconnections. By default, if the websocket hasn't received data for 2 minutes, it will call a shutdown, which the connection monitor will reconnect and the subscription handler will resubscribe to everything.
I've also re-added all the websocket connection tests that were removed in #328 which none of us noticed
Type of change
Please delete options that are not relevant and add an
How Has This Been Tested?
wshandler_test has fancy new tests. Running the application, killing the connection, enabling connection and watching all exchanges reconnect to the websocket and resubscribe
@@ Coverage Diff @@ ## engine #360 +/- ## ========================================== + Coverage 41.23% 41.81% +0.57% ========================================== Files 149 149 Lines 33544 33598 +54 ========================================== + Hits 13831 14048 +217 + Misses 18780 18595 -185 - Partials 933 955 +22
…Deletes WebsocketReset. Utilises ReadMessageErrors channel for all websocket readmessages to analyse when an error returned is due to a disconnect
…fic monitor should die. Default to two minutes of no traffic activity. Increases test coverage and updates existing tests to work with new technologic. RE-ADDS TESTS I ACCIDENTALLY DELETED FROM PREVIOUS PR
…connections. Increases test coverage. Re-adds tests that were ACCIDENTALLY DELETED. Removes unused websocket channels. Bug fix for traffic monitor to shutdown via goroutine instead of killing itself
…ry to syncer for when websocket is switched to rest and then back, you get a log notifying of the return. Fixes okgroup bug where ws message is sent on a disconnected ws, causing panic. Renames setConnectionStatus to setConnectedStatus. Puts connection monitor log behind verbose bool
… Expands disconnection error definition. Removes routine disconnection error handling. Ensures only one traffic monitor can ever be run. Renames subscriptionLock to subscriptionMutext for consistency
thrasher- left a comment
xtda left a comment