feat(quic): add stream idle timeouts - #2947
Conversation
gmelodie
left a comment
There was a problem hiding this comment.
Cool! I just wonder why different timeouts for inbound and outbound streams, and why is there need for a timeout handler (what else would someone want to do other than reset the stream?)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2947 +/- ##
==========================================
+ Coverage 82.22% 82.25% +0.03%
==========================================
Files 177 178 +1
Lines 32374 32476 +102
Branches 12 12
==========================================
+ Hits 26618 26714 +96
- Misses 5756 5762 +6
🚀 New features to boost your workflow:
|
Good question. I copied the style for handling timeouts from withYamux and withMplex , but do not know the reasoning behind having separate parameters. Downstream i checked and both nimbus and delivery set it to 5m. .. i could set it as a single value but then lose consistency against other muxers, or... change all muxers so they have a single parameter, but then we end up with a breaking change :(
The timeout handler is called by the connection activity monitor once it detects that the stream got idle https://github.com/vacp2p/nim-libp2p/blob/master/libp2p/stream/connection.nim#L118-L122 |
|
Claude's reasoning for the first question seems to make sense:
I meant why does this need to be a configurable handler instead of a "static" |
Summary
Affected Areas
Impact on Library Users
QUIC streams now use the same five-minute default inactivity timeout as mplex and yamux. Applications can customize the values through
withQuicTransport(inTimeout, outTimeout)or theQuicTransportconstructors.Risk Assessment
Long-lived QUIC streams with no reads or writes will now be reset after the configured timeout. Active sibling streams and the underlying QUIC connection remain open.