Skip to content

Commit

Permalink
fix: Avoid spammy logging on hitting the entwork's BoundedExecutor (#763
Browse files Browse the repository at this point in the history
)

We operate an executor with a bound on the concurrent number of messages (see #463, #559, #706).
PR #472 added logging for the bound being hit.

We expect the executors to operate for a long time at this limit (e.g. in recovery situation).
The spammy logging is not usfeful

This removes the logging of the concurrency bound being hit.
Fixes #759
  • Loading branch information
huitseeker authored Aug 15, 2022
1 parent cd22186 commit 801f306
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion narwhal/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ impl<T> std::future::Future for CancelOnDropHandler<T> {
//
// The exact number here probably isn't important, the key things is that it should be finite so
// that we don't create unbounded numbers of tasks.
pub const MAX_TASK_CONCURRENCY: usize = 200;
pub const MAX_TASK_CONCURRENCY: usize = 500;
12 changes: 4 additions & 8 deletions narwhal/network/src/primary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use rand::{rngs::SmallRng, SeedableRng as _};
use std::collections::HashMap;
use tokio::{runtime::Handle, task::JoinHandle};
use tonic::transport::Channel;
use tracing::warn;
use types::{
BincodeEncodedPayload, PrimaryMessage, PrimaryToPrimaryClient, PrimaryToWorkerClient,
PrimaryWorkerMessage,
Expand Down Expand Up @@ -63,13 +62,10 @@ impl PrimaryNetwork {
fn update_metrics(&self) {
if let Some(m) = &self.metrics {
for (addr, executor) in &self.executors {
let available = executor.available_capacity();

m.set_network_available_tasks(available as i64, Some(addr.to_string()));

if available == 0 {
warn!("Executor in network:{} and module:{} available tasks is 0 for client address: {}", m.network_type(), m.module_tag(), addr);
}
m.set_network_available_tasks(
executor.available_capacity() as i64,
Some(addr.to_string()),
);
}
}
}
Expand Down
7 changes: 0 additions & 7 deletions narwhal/network/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use rand::{rngs::SmallRng, SeedableRng as _};
use std::collections::HashMap;
use tokio::{runtime::Handle, task::JoinHandle};
use tonic::transport::Channel;
use tracing::warn;
use types::{
BincodeEncodedPayload, WorkerMessage, WorkerPrimaryMessage, WorkerToPrimaryClient,
WorkerToWorkerClient,
Expand Down Expand Up @@ -61,16 +60,10 @@ impl WorkerNetwork {
fn update_metrics(&self) {
if let Some(m) = &self.metrics {
for (addr, executor) in &self.executors {
let available = executor.available_capacity();

m.set_network_available_tasks(
executor.available_capacity() as i64,
Some(addr.to_string()),
);

if available == 0 {
warn!("Executor in network:{} and module:{} available tasks is 0 for client address: {}", m.network_type(), m.module_tag(), addr);
}
}
}
}
Expand Down

0 comments on commit 801f306

Please sign in to comment.