Skip to content

Commit 57914b8

Browse files
authored
Use MissedTickBehavior::Delay for propagation_interval (#1301)
The default behavior is Burst which doesn't fit this use-case since we are buffering changes, so it doesn't make sense to burst away 2 responses if we happen to miss one tick https://docs.rs/tokio/latest/tokio/time/enum.MissedTickBehavior.html#variant.Delay
1 parent 288cab6 commit 57914b8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/xds/src/server.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ impl<C: crate::config::Configuration> ControlPlane<C> {
418418
let buffer = ResponseBroadcastPropagationBuffer::default();
419419
let mut lag_amount: u64 = 0;
420420
let mut propagation_interval = tokio::time::interval(RESPONSE_PROPAGATION_INTERVAL);
421+
propagation_interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Delay);
421422

422423
loop {
423424
tokio::select! {
@@ -850,6 +851,7 @@ impl<C: crate::config::Configuration> AggregatedControlPlaneDiscoveryService for
850851
let buffer = ResponseBroadcastPropagationBuffer::default();
851852
let mut lag_amount: u64 = 0;
852853
let mut propagation_interval = tokio::time::interval(RESPONSE_PROPAGATION_INTERVAL);
854+
propagation_interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Delay);
853855

854856
loop {
855857
tokio::select! {

0 commit comments

Comments
 (0)