Skip to content

fix(online): Preserve WebSocket sends under backpressure - #644

Closed
tintinhamans wants to merge 12 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/fix/websocket-resilience
Closed

tintinhamans wants to merge 12 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/fix/websocket-resilience

Conversation

@tintinhamans

@tintinhamans tintinhamans commented Oct 23, 2026 •

Copy link
Copy Markdown

Merge after #625.

WebSocket::Tick sent the whole outbound queue every tick and only logged a failed curl_ws_send. A partial send or CURLE_AGAIN dropped the rest of that frame, so the next message went out in the middle of it, and a full queue discarded the oldest message even when it was the one half sent.

FlushOutbound now keeps the offset into the front message and sends the rest on the next call. The queue is capped at 256 messages and 2 MiB and rejects the newest message when full. A flush stops after 16 sends or 256 KiB so it cannot hold the game thread, and Disconnect only sends CLOSE when nothing is half sent.

CURLE_AGAIN is treated as backpressure, any other send or receive error starts a reconnect, and liveness is only refreshed on CURLE_OK. The heartbeat is queued once, not again every interval while the socket is stalled. The timeouts are unchanged.

@tintinhamans
tintinhamans force-pushed the arctic/go/fix/websocket-resilience branch from d524281 to 35edba8 Compare October 24, 2026 19:06
@tintinhamans

Copy link
Copy Markdown
Author

Folded into #645, which now carries its commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant