feat(transport-ws): make keepalive interval configurable#3660
Merged
Conversation
Co-authored-by: DaniPopes <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-019c3a73-d59f-7360-a133-1c6872671d4a Co-authored-by: Amp <[email protected]>
DaniPopes
approved these changes
Feb 7, 2026
Member
Author
|
Wait why are we fsyncing for 29 seconds lol |
Member
|
on startup |
onbjerg
approved these changes
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
with_keepalive_intervaltoWsConnect, replacing the hardcoded 10sKEEPALIVEconstant.Motivation
reth-bench persistence subscriptions disconnect during long MDBX fsyncs (29s+). The server can't respond to pings while stalled by I/O, so alloy's 10s keepalive kills the connection with "WS server missed a pong". Making this configurable lets consumers like reth-bench set a longer interval.
Changes
keepalive_interval: Durationfield toWsConnect(default 10s, backwards-compatible)with_keepalive_interval(Duration)builder methodWsBackendand use it inspawn()instead of the hardcoded constantWsBackendstruct shapeTesting
All clean.