Skip to content

Commit 6379497

Browse files
committed
qos_core: add timeout assert and processor info comment
1 parent 7da47a2 commit 6379497

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/qos_core/src/protocol/processor.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{
1616
const MEGABYTE: usize = 1024 * 1024;
1717
const MAX_ENCODED_MSG_LEN: usize = 128 * MEGABYTE;
1818

19-
/// Initial client timeout for the processor until the Manifest says otherwise
19+
/// Initial client timeout for the processor until the Manifest says otherwise, see reaper.rs
2020
pub const INITIAL_CLIENT_TIMEOUT: Duration = Duration::from_secs(5);
2121

2222
/// Helper type to keep `ProtocolState` shared using `Arc<Mutex<ProtocolState>>`
@@ -52,8 +52,9 @@ impl ProtocolProcessor {
5252
self.state.read().await.get_phase()
5353
}
5454

55-
/// Sets the client timeout value for the `app_client`
55+
/// Sets the client timeout value for the `app_client`, maximum allowed value is `u16::MAX` milliseconds
5656
pub fn set_client_timeout(&mut self, timeout: Duration) {
57+
assert!(timeout.as_millis() < u16::MAX.into(), "client timeout > 65s");
5758
self.app_client.set_timeout(timeout);
5859
}
5960

0 commit comments

Comments
 (0)