add more error telemetry

This commit is contained in:
Christien Rioux
2023-07-13 14:16:14 -04:00
parent a06f24e287
commit 5977b6a141
4 changed files with 92 additions and 30 deletions

View File

@@ -807,17 +807,6 @@ impl NetworkManager {
body: B,
) -> EyreResult<NetworkResult<SendDataKind>> {
let destination_node_ref = destination_node_ref.as_ref().unwrap_or(&node_ref).clone();
if !node_ref.same_entry(&destination_node_ref) {
log_net!(
"sending envelope to {:?} via {:?}",
destination_node_ref,
node_ref
);
} else {
log_net!("sending envelope to {:?}", node_ref);
}
let best_node_id = destination_node_ref.best_node_id();
// Get node's envelope versions and see if we can send to it
@@ -832,6 +821,17 @@ impl NetworkManager {
// Build the envelope to send
let out = self.build_envelope(best_node_id, envelope_version, body)?;
if !node_ref.same_entry(&destination_node_ref) {
log_net!(
"sending envelope to {:?} via {:?}, len={}",
destination_node_ref,
node_ref,
out.len()
);
} else {
log_net!("sending envelope to {:?}, len={}", node_ref, out.len());
}
// Send the envelope via whatever means necessary
self.send_data(node_ref, out).await
}

View File

@@ -31,8 +31,24 @@ impl RawUdpProtocolHandler {
}
// Insert into assembly buffer
let Some(message) = self.assembly_buffer.insert_frame(&data[0..size], remote_addr) else {
continue;
let message = match self
.assembly_buffer
.insert_frame(&data[0..size], remote_addr)
{
NetworkResult::Value(Some(v)) => v,
NetworkResult::Value(None) => {
continue;
}
nres => {
#[cfg(feature = "network-result-extra")]
log_network_result!(
"UDP::recv_message insert_frame failed: {:?} <= size={} remote_addr={}",
nres,
size,
remote_addr
);
continue;
}
};
// Check length of reassembled message (same for all protocols)