Skip to content

Commit

Permalink
Change wait_before_drop unit from nanos to micros
Browse files Browse the repository at this point in the history
  • Loading branch information
JEnoch committed Mar 20, 2024
1 parent 21f6830 commit 3fc2103
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DEFAULT_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@
/// Using CongestionControl::Block the caller is blocked until a batch is available and re-insterted into the queue.
/// Using CongestionControl::Drop the message might be dropped, depending on conditions configured here.
congestion_control: {
/// The maximum time in nanosecond to wait for an available batch before dropping the message if still no batch is available.
wait_before_drop: 1000000
/// The maximum time in microseconds to wait for an available batch before dropping the message if still no batch is available.
wait_before_drop: 1000
},
/// The initial exponential backoff time in nanoseconds to allow the batching to eventually progress.
/// Higher values lead to a more aggressive batching but it will introduce additional latency.
Expand Down
2 changes: 1 addition & 1 deletion commons/zenoh-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl Default for QueueSizeConf {
impl Default for CongestionControlConf {
fn default() -> Self {
Self {
wait_before_drop: 1000000,
wait_before_drop: 1000,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion commons/zenoh-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ validated_struct::validator! {
/// Using CongestionControl::Block the caller is blocked until a batch is available and re-insterted into the queue.
/// Using CongestionControl::Drop the message might be dropped, depending on conditions configured here.
pub congestion_control: CongestionControlConf {
/// The maximum time in nanosecond to wait for an available batch before dropping the message if still no batch is available.
/// The maximum time in microseconds to wait for an available batch before dropping the message if still no batch is available.
pub wait_before_drop: u64,
},
/// The initial exponential backoff time in nanoseconds to allow the batching to eventually progress.
Expand Down
4 changes: 2 additions & 2 deletions io/zenoh-transport/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl TransportManagerBuilder {
self = self.batch_size(*link.tx().batch_size());
self = self.defrag_buff_size(*link.rx().max_message_size());
self = self.link_rx_buffer_size(*link.rx().buffer_size());
self = self.wait_before_drop(Duration::from_nanos(
self = self.wait_before_drop(Duration::from_micros(
*link.tx().queue().congestion_control().wait_before_drop(),
));
self = self.queue_size(link.tx().queue().size().clone());
Expand Down Expand Up @@ -311,7 +311,7 @@ impl Default for TransportManagerBuilder {
whatami: zenoh_config::defaults::mode,
resolution: Resolution::default(),
batch_size: BatchSize::MAX,
wait_before_drop: Duration::from_nanos(wait_before_drop),
wait_before_drop: Duration::from_micros(wait_before_drop),
queue_size: queue.size,
queue_backoff: Duration::from_nanos(backoff),
defrag_buff_size: *link_rx.max_message_size(),
Expand Down

0 comments on commit 3fc2103

Please sign in to comment.