Commit 6e1e935
committed
Don't block IceAdapter.start() on telemetry websocket connect (fixes #42)
TelemetryDebugger.startupComplete() called websocketClient.connectBlocking()
synchronously on the IceAdapter startup thread, with no timeout. Telemetry
is a debug-only observability channel - its data flow is strictly outgoing
(see ice-adapter/src/main/java/com/faforever/iceadapter/telemetry/, all
messages implement OutgoingMessageV1) and no game logic depends on it being
connected - so it should never gate peer connectivity.
When the telemetry server is silently unreachable (TCP layer up but app
layer hung - for example an alive load balancer fronting a dead backend),
the WebSocket Upgrade handshake never receives an HTTP 101 response.
connectBlocking() then waits until TCP keepalive eventually kills the
socket, about two hours later. During that whole window IceAdapter.start()
is blocked, the FAF client's adapter-ready orchestration trips its own
timeouts, and the user-visible symptom is "the ice adapter doesn't connect
to other players".
Fix: run the connect on a virtual thread so startup returns immediately.
The pre-existing reconnect loop in sendingLoop() already handles transient
drops, and queued messages catch up once the socket opens because the
messageQueue is unbounded.
Also adds the missing return after the InterruptedException catch
(previously fell through to sendMessage on an interrupted thread) and
re-asserts the interrupt flag, per Java best practice.
Fixes #421 parent d49f9fe commit 6e1e935
1 file changed
Lines changed: 19 additions & 8 deletions
Lines changed: 19 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
120 | 132 | | |
| 133 | + | |
| 134 | + | |
121 | 135 | | |
122 | 136 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 137 | | |
128 | | - | |
129 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
130 | 141 | | |
131 | 142 | | |
132 | 143 | | |
| |||
0 commit comments