From b2ebaa9389554a3c4c8d17f48c350b5309a0f4c7 Mon Sep 17 00:00:00 2001 From: Ben Horowitz Date: Thu, 24 Nov 2022 15:06:00 -0800 Subject: [PATCH] Adds to infected when gossip received from 2nd and following senders --- .../java/io/scalecube/cluster/gossip/GossipProtocolImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cluster/src/main/java/io/scalecube/cluster/gossip/GossipProtocolImpl.java b/cluster/src/main/java/io/scalecube/cluster/gossip/GossipProtocolImpl.java index 6c46dda9..2f24beb8 100644 --- a/cluster/src/main/java/io/scalecube/cluster/gossip/GossipProtocolImpl.java +++ b/cluster/src/main/java/io/scalecube/cluster/gossip/GossipProtocolImpl.java @@ -203,13 +203,15 @@ private void onGossipRequest(Message message) { final long period = this.currentPeriod; final GossipRequest gossipRequest = message.data(); for (Gossip gossip : gossipRequest.gossips()) { + GossipState gossipState = gossips.get(gossip.gossipId()); if (ensureSequence(gossip.gossiperId()).add(gossip.sequenceId())) { - GossipState gossipState = gossips.get(gossip.gossipId()); if (gossipState == null) { // new gossip gossipState = new GossipState(gossip, period); gossips.put(gossip.gossipId(), gossipState); sink.emitNext(gossip.message(), RETRY_NON_SERIALIZED); } + } + if (gossipState != null) { gossipState.addToInfected(gossipRequest.from()); } }