Skip to content

Commit f2284ce

Browse files
committed
fix: adjust expiring reset stream limits
1 parent c85d1e8 commit f2284ce

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ impl Builder {
923923
/// received for that stream will result in a connection level protocol
924924
/// error, forcing the connection to terminate.
925925
///
926-
/// The default value is 10.
926+
/// The default value is currently 50.
927927
///
928928
/// # Examples
929929
///
@@ -968,7 +968,7 @@ impl Builder {
968968
/// received for that stream will result in a connection level protocol
969969
/// error, forcing the connection to terminate.
970970
///
971-
/// The default value is 30 seconds.
971+
/// The default value is currently 1 second.
972972
///
973973
/// # Examples
974974
///

src/proto/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ pub type WindowSize = u32;
3333
pub const MAX_WINDOW_SIZE: WindowSize = (1 << 31) - 1; // i32::MAX as u32
3434
pub const DEFAULT_REMOTE_RESET_STREAM_MAX: usize = 20;
3535
pub const DEFAULT_LOCAL_RESET_COUNT_MAX: usize = 1024;
36-
pub const DEFAULT_RESET_STREAM_MAX: usize = 10;
37-
pub const DEFAULT_RESET_STREAM_SECS: u64 = 30;
36+
// RFC 9113 suggests allowing at minimum 100 streams, it seems reasonable to
37+
// by default allow a portion of that to be remember as rest for some time.
38+
pub const DEFAULT_RESET_STREAM_MAX: usize = 50;
39+
// RFC 9113#5.4.2 suggests ~1 RTT. We don't track that closely, but use a
40+
// reasonable guess of the average here.
41+
pub const DEFAULT_RESET_STREAM_SECS: u64 = 1;
3842
pub const DEFAULT_MAX_SEND_BUFFER_SIZE: usize = 1024 * 400;

src/proto/streams/recv.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,11 +912,12 @@ impl Recv {
912912
return;
913913
}
914914

915-
tracing::trace!("enqueue_reset_expiration; {:?}", stream.id);
916-
917915
if counts.can_inc_num_reset_streams() {
918916
counts.inc_num_reset_streams();
917+
tracing::trace!("enqueue_reset_expiration; added {:?}", stream.id);
919918
self.pending_reset_expired.push(stream);
919+
} else {
920+
tracing::trace!("enqueue_reset_expiration; dropped {:?}, over max_concurrent_reset_streams", stream.id);
920921
}
921922
}
922923

src/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ impl Builder {
868868
/// received for that stream will result in a connection level protocol
869869
/// error, forcing the connection to terminate.
870870
///
871-
/// The default value is 10.
871+
/// The default value is currently 50.
872872
///
873873
/// # Examples
874874
///
@@ -993,7 +993,7 @@ impl Builder {
993993
/// received for that stream will result in a connection level protocol
994994
/// error, forcing the connection to terminate.
995995
///
996-
/// The default value is 30 seconds.
996+
/// The default value is currently 1 second.
997997
///
998998
/// # Examples
999999
///

0 commit comments

Comments
 (0)