diff options
| author | tv <tv@krebsco.de> | 2026-11-01 21:01:43 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-01 21:01:43 +0100 |
| commit | 0d537aa65fcb777cf11fb6c4c6ce8d2e75c1304c (patch) | |
| tree | e540a16e3746f8b5b529daa66c7e194618a662fb /src/main.rs | |
| parent | f8b10bdd4481edf2250293c39182436923fd2f89 (diff) | |
introduce per-transport sync reply timeout
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index f170434..6c37872 100644 --- a/src/main.rs +++ b/src/main.rs @@ -188,6 +188,12 @@ async fn main() -> Result<()> { .map(|(_, transport)| transport.delivery_limit()) .max() .unwrap_or_default(); + // An answer may come over any of them. + let sync_reply_timeout = transports + .iter() + .map(|(_, transport)| transport.sync_reply_timeout()) + .max() + .unwrap_or(state::SYNC_REPLY_TIMEOUT); let mut transports = transports.into_iter(); let (scheme, transport) = transports.next().context("No transports")?; @@ -209,7 +215,7 @@ async fn main() -> Result<()> { initial_epoch, initial_doc, earlier_actors, - timing: state::Timing::from_keepalive(args.keepalive, delivery_limit) + timing: state::Timing::new(args.keepalive, sync_reply_timeout, delivery_limit) .with_probe_max(args.dormant_probe_max), neighbours_k: args.neighbours, alias: args.alias.clone(), |
