• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sonirico / go-hyperliquid / 21688282661

04 Feb 2026 09:03PM UTC coverage: 18.295% (+0.5%) from 17.816%
21688282661

push

github

web-flow
fix: add read deadline to WebSocket readPump, reconnect on stall (#128)

readPump called conn.ReadMessage() with no deadline. If the server
stopped sending frames without closing the connection the goroutine
blocked in a TLS read indefinitely, starving all subscribers.

Changes:
- Set conn.SetReadDeadline before every ReadMessage call (default 90 s,
  chosen to exceed the 50 s ping interval so normal pong cycles do not
  false-positive).
- On a net timeout error the connection is closed and reconnect() is
  invoked from the deferred cleanup, reusing the existing exponential-
  backoff path.
- Expose WsOptReadTimeout so callers can tune the deadline.
- Resolve the long-standing TODO in PongDispatcher: keepalive is now
  implicit — every successful read resets the deadline on the next
  iteration.
- Add TestReadPumpReconnectsOnTimeout: mock server that holds the
  connection open without sending; asserts the client reconnects within
  the test window.

Co-authored-by: coder-ishan <ishansingh2609@gmail.com>

17 of 20 new or added lines in 2 files covered. (85.0%)

1 existing line in 1 file now uncovered.

3459 of 18907 relevant lines covered (18.29%)

281.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.43
/ws_msg_dispatch.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc