Skip to content

Commit 7c23625

Browse files
Quieten gossip republish logs (#5235)
* Quieten gossip republish logs
1 parent 256d904 commit 7c23625

File tree

1 file changed

+27
-10
lines changed
  • beacon_node/lighthouse_network/src/service

1 file changed

+27
-10
lines changed

beacon_node/lighthouse_network/src/service/mod.rs

+27-10
Original file line numberDiff line numberDiff line change
@@ -1226,22 +1226,39 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
12261226
.publish(Topic::from(topic.clone()), data)
12271227
{
12281228
Ok(_) => {
1229-
warn!(self.log, "Gossip message published on retry"; "topic" => topic_str);
1230-
if let Some(v) = metrics::get_int_counter(
1229+
debug!(
1230+
self.log,
1231+
"Gossip message published on retry";
1232+
"topic" => topic_str
1233+
);
1234+
metrics::inc_counter_vec(
12311235
&metrics::GOSSIP_LATE_PUBLISH_PER_TOPIC_KIND,
12321236
&[topic_str],
1233-
) {
1234-
v.inc()
1235-
};
1237+
);
1238+
}
1239+
Err(PublishError::Duplicate) => {
1240+
debug!(
1241+
self.log,
1242+
"Gossip message publish ignored on retry";
1243+
"reason" => "duplicate",
1244+
"topic" => topic_str
1245+
);
1246+
metrics::inc_counter_vec(
1247+
&metrics::GOSSIP_FAILED_LATE_PUBLISH_PER_TOPIC_KIND,
1248+
&[topic_str],
1249+
);
12361250
}
12371251
Err(e) => {
1238-
warn!(self.log, "Gossip message publish failed on retry"; "topic" => topic_str, "error" => %e);
1239-
if let Some(v) = metrics::get_int_counter(
1252+
warn!(
1253+
self.log,
1254+
"Gossip message publish failed on retry";
1255+
"topic" => topic_str,
1256+
"error" => %e
1257+
);
1258+
metrics::inc_counter_vec(
12401259
&metrics::GOSSIP_FAILED_LATE_PUBLISH_PER_TOPIC_KIND,
12411260
&[topic_str],
1242-
) {
1243-
v.inc()
1244-
};
1261+
);
12451262
}
12461263
}
12471264
}

0 commit comments

Comments
 (0)