node: Add warning if workers are all busy

This commit is contained in:
Alexis Sellier 2023-04-26 09:58:48 +02:00
parent 10fe2ae299
commit ccbfe5b6fa
No known key found for this signature in database
1 changed files with 6 additions and 0 deletions

View File

@ -843,6 +843,12 @@ where
channels,
};
if !self.worker.is_empty() {
log::warn!(
target: "wire",
"Worker pool is busy: {} tasks pending, fetch requests may be delayed", self.worker.len()
);
}
if self.worker.send(task).is_err() {
log::error!(target: "wire", "Worker pool is disconnected; cannot send fetch request");
}