Skip to content

Commit 4608c7e

Browse files
committed
[FAB-4077] Fix gossip false negative WARN log
When a peer determines whether a given peer is eligible for receiving blocks for some channel, it looks up the latest state info message that the remote peer has sent. In some situations, especially at boot time - the peer might get a message for that channel (i.e a hello message for blocks pulling) from that remote peer before it has received a stateInfo message from that peer. This results in a printing of a warning that a peer attempted to pull blocks but wasn't eligible for the channel. This warning is a false negative and disappears after a while when the peer receives the StateInfo message of the remote peer. I added a check to ensure that if the peer doesn't have a stateInfo message of the remote peer in the cache, to abort the check. Change-Id: I539a600e4eb592eb3e14db8433c6490520618fed Signed-off-by: Yacov Manevich <[email protected]>
1 parent eaf7f4d commit 4608c7e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

gossip/gossip/channel/channel.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,14 @@ func (gc *gossipChannel) HandleMessage(msg proto.ReceivedMessage) {
437437
return
438438
}
439439
if m.IsPullMsg() && m.GetPullMsgType() == proto.PullMsgType_BLOCK_MSG {
440+
// If we don't have a StateInfo message from the peer,
441+
// no way of validating its eligibility in the channel.
442+
if gc.stateInfoMsgStore.MsgByID(msg.GetConnectionInfo().ID) == nil {
443+
gc.logger.Debug("Don't have StateInfo message of peer", msg.GetConnectionInfo())
444+
return
445+
}
440446
if !gc.eligibleForChannelAndSameOrg(discovery.NetworkMember{PKIid: msg.GetConnectionInfo().ID}) {
441-
gc.logger.Warning(msg.GetConnectionInfo().ID, "isn't eligible for pulling blocks of", string(gc.chainID))
447+
gc.logger.Warning(msg.GetConnectionInfo(), "isn't eligible for pulling blocks of", string(gc.chainID))
442448
return
443449
}
444450
if m.IsDataUpdate() {

0 commit comments

Comments
 (0)