Merge branch 'hotfix/fix-staggered-idle-wake'
Rust CI / cargo fmt (push) Successful in 17s
Rust CI / cargo clippy (push) Successful in 30s
Rust CI / cargo check (x86_64-unknown-linux-gnu) (push) Successful in 28s
Rust CI / cargo check (x86_64-unknown-linux-musl) (push) Failing after 7s
Rust CI / cargo test (x86_64-unknown-linux-musl) (push) Failing after 8s
Rust CI / cargo doc (push) Successful in 25s
Rust CI / cargo test (x86_64-unknown-linux-gnu) (push) Successful in 1m11s
Fuzz Smoke / cargo fuzz smoke (push) Failing after 28s
Supply chain / cargo-deny advisories (push) Successful in 7s
Supply chain / cargo-deny bans licenses sources (push) Successful in 6s
Supply chain / actionlint (push) Successful in 2s
Netem Interop / netem interop (push) Successful in 1m6s

This commit is contained in:
Nils Andreas Svee committed 2026-10-04 12:04:15 +07:00
commit 524d56f72c
1 file changed
+23 -5
+23 -5
View File
@@ -1968,11 +1968,7 @@ impl ManagedClientTask {
&& self.config.pacing == ManagedPacing::Staggered && self.config.pacing == ManagedPacing::Staggered
&& self.active_count() > 0 && self.active_count() > 0
{ {
send_deadline = match (send_deadline, self.send_gate) { send_deadline = gated_send_deadline(send_deadline, self.send_gate);
(Some(target), Some(gate)) => Some(target.max(gate)),
(None, gate) => gate,
(target, None) => target,
};
} }
non_send_deadline.into_iter().chain(send_deadline).min() non_send_deadline.into_iter().chain(send_deadline).min()
} }
@@ -2070,6 +2066,11 @@ impl ManagedClientTask {
} }
} }
// A release gate delays a send opportunity; it cannot create one.
fn gated_send_deadline(cadence: Option<Instant>, gate: Option<Instant>) -> Option<Instant> {
cadence.map(|deadline| gate.map_or(deadline, |gate| deadline.max(gate)))
}
#[derive(Clone, Copy, Eq, PartialEq)] #[derive(Clone, Copy, Eq, PartialEq)]
enum SendResult { enum SendResult {
NotAttempted, NotAttempted,
@@ -2398,6 +2399,23 @@ fn close_timeout_failure() -> ManagedTargetFailure {
mod tests { mod tests {
use super::*; use super::*;
#[test]
fn release_gate_only_delays_an_existing_send_deadline() {
let earlier = Instant::now();
let later = earlier + Duration::from_secs(1);
for (cadence, gate, expected) in [
(None, None, None),
(None, Some(earlier), None),
(None, Some(later), None),
(Some(earlier), None, Some(earlier)),
(Some(later), Some(earlier), Some(later)),
(Some(earlier), Some(earlier), Some(earlier)),
(Some(earlier), Some(later), Some(later)),
] {
assert_eq!(gated_send_deadline(cadence, gate), expected);
}
}
// Poll latency through public events cannot distinguish an O(n) discovery // Poll latency through public events cannot distinguish an O(n) discovery
// scan from a bounded scan reliably. This tiny inspection trace measures // scan from a bounded scan reliably. This tiny inspection trace measures
// work directly, including empty targets, and checks eventual coverage // work directly, including empty targets, and checks eventual coverage