Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions clients/ws_json_rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,19 @@ const (
// re-dials. wsPongWait must comfortably exceed wsPingInterval so at least
// two pings fit in the window.
//
// Sized so a black-holed upstream is torn down and re-dialed before typical
// downstream head-liveness thresholds (~30s, e.g. Polygon NoNewHeadsThreshold).
// Sticky client WS connections pin one eRPC pod: if that pod's head-feeding
// upstream wedges for wsPongWait, the client sees silence even while other
// pods / HTTP failover still tip. 30s/75s left a ~45s gap where consumers
// marked the gateway unhealthy before we reconnected.
//
// Vars (not consts) so tests can compress time. They are copied into
// per-client fields at construction, so client goroutines never read them
// after NewWsJsonRpcClient returns.
var (
wsPingInterval = 30 * time.Second
wsPongWait = 75 * time.Second
wsPingInterval = 10 * time.Second
wsPongWait = 25 * time.Second
)

// WsJsonRpcClient implements ClientInterface for WebSocket-based JSON-RPC upstream connections.
Expand Down
Loading