Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): improve logging of dropped reply channels #4702

Merged
merged 1 commit into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions base_layer/core/src/base_node/service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,13 @@ where B: BlockchainBackend + 'static
let result = handle_incoming_block(inbound_nch, new_block).await;

match result {
Ok(()) => {},
Err(BaseNodeServiceError::CommsInterfaceError(CommsInterfaceError::ChainStorageError(
ChainStorageError::AddBlockOperationLocked,
))) => {
// Special case, dont log this again as an error
},
Err(e) => error!(target: LOG_TARGET, "Failed to handle incoming block message: {:?}", e),
_ => {},
Err(e) => error!(target: LOG_TARGET, "Failed to handle incoming block message: {}", e),
}
});
}
Expand All @@ -324,10 +324,11 @@ where B: BlockchainBackend + 'static
);
}
let result = reply_tx.send(res);
if let Err(e) = result {
if let Err(res) = result {
error!(
target: LOG_TARGET,
"BaseNodeService failed to send reply to local request {:?}", e
"BaseNodeService failed to send reply to local request {:?}",
res.map(|r| r.to_string()).map_err(|e| e.to_string())
);
}
});
Expand All @@ -339,10 +340,11 @@ where B: BlockchainBackend + 'static
let (block, reply_tx) = block_context.split();
let result = reply_tx.send(inbound_nch.handle_block(Arc::new(block), None).await);

if let Err(e) = result {
if let Err(res) = result {
error!(
target: LOG_TARGET,
"BaseNodeService failed to send reply to local block submitter {:?}", e
"BaseNodeService failed to send reply to local block submitter {:?}",
res.map(|r| r.to_string()).map_err(|e| e.to_string())
);
}
});
Expand Down
19 changes: 10 additions & 9 deletions base_layer/core/src/mempool/service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ impl MempoolService {
// Incoming transaction messages from the Comms layer
Some(transaction_msg) = inbound_transaction_stream.next() => {
let result = handle_incoming_tx(&mut self.inbound_handlers, transaction_msg).await;
if let Err(e) = result {
error!(
target: LOG_TARGET,
"Failed to handle incoming transaction message: {:?}", e
);
}
if let Err(e) = result {
error!(
target: LOG_TARGET,
"Failed to handle incoming transaction message: {:?}", e
);
}
}

// Incoming local request messages from the LocalMempoolServiceInterface and other local services
Expand Down Expand Up @@ -152,10 +152,11 @@ impl MempoolService {
let (request, reply_tx) = request_context.split();
let result = reply_tx.send(inbound_handlers.handle_request(request).await);

if let Err(e) = result {
if let Err(res) = result {
error!(
target: LOG_TARGET,
"MempoolService failed to send reply to local request {:?}", e
"MempoolService failed to send reply to local request {:?}",
res.map(|r| r.to_string()).map_err(|e| e.to_string())
);
}
});
Expand All @@ -166,7 +167,7 @@ impl MempoolService {
task::spawn(async move {
let result = inbound_handlers.handle_block_event(&block_event).await;
if let Err(e) = result {
error!(target: LOG_TARGET, "Failed to handle base node block event: {:?}", e);
error!(target: LOG_TARGET, "Failed to handle base node block event: {}", e);
}
});
}
Expand Down