fix(shard): Ignore duplicate node adds with same message ID (#514)

* fix(shard): Ignore duplicate node adds with same message ID

* adapt the test
This commit is contained in:
Igor Matuszewski
2022-11-30 14:17:07 +01:00
committed by GitHub
parent f72d62bbc1
commit bbf2a5d4b0
2 changed files with 69 additions and 1 deletions
+5 -1
View File
@@ -352,7 +352,11 @@ where
}
// Note of the message ID, allowing telemetry for it.
allowed_message_ids.insert(message_id, Instant::now());
let prev_join_time = allowed_message_ids.insert(message_id, Instant::now());
if prev_join_time.is_some() {
log::info!("Ignoring duplicate new node with ID {message_id} from {real_addr:?}");
continue;
}
// Tell the aggregator loop about the new node.
log::info!("Adding node with message ID {message_id} from {real_addr:?}");