Skip to content

Commit 2993534

Browse files
committed
[FAB-5052] [FAB-5051] Fine tune log messages
FAB-5052: In gossip when a peer obtains an AliveMessage from a peer it hasn't received its certificate yet - it complains in the log in WARNING that it has received a message from some peer it can't verify its identity. This is actually a common scenario where a peer is restarted and its in-meory certificate store is now empty, but the other peers contact the peer and send it alive messages which he can't verify until it syncs its certificates with them. This startles users and I think we should reduce the logging severity from WARN to DEBUG. FAB-5051: When a peer is in a partition or is dead for a long enough time, gossip prints: Haven't heard from", <gibberish>, "for" <elapsed time> The problem is that the id is a string of a hash and its printed in gibberish. It's not something humans can read, and we need to cast the string back to []byte so it would be human readable. Change-Id: I94bcad11623e53b5275ef8cecbdd3f9563fa1e77 Signed-off-by: yacovm <[email protected]>
1 parent b93fb81 commit 2993534

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gossip/discovery/discovery_impl.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func (d *gossipDiscoveryImpl) handleMsgFromComm(m *proto.SignedGossipMessage) {
390390
return
391391
}
392392
if !d.crypt.ValidateAliveMsg(dm) {
393-
d.logger.Warningf("Alive message isn't authentic, someone spoofed %s's identity", dm.GetAliveMsg().Membership)
393+
d.logger.Debugf("Alive message isn't authentic, someone spoofed %s's identity", dm.GetAliveMsg().Membership)
394394
continue
395395
}
396396

@@ -488,7 +488,7 @@ func (d *gossipDiscoveryImpl) handleAliveMessage(m *proto.SignedGossipMessage) {
488488
defer d.logger.Debug("Exiting")
489489

490490
if !d.crypt.ValidateAliveMsg(m) {
491-
d.logger.Warningf("Alive message isn't authentic, someone must be spoofing %s's identity", m.GetAliveMsg())
491+
d.logger.Debugf("Alive message isn't authentic, someone must be spoofing %s's identity", m.GetAliveMsg())
492492
return
493493
}
494494

@@ -719,7 +719,7 @@ func (d *gossipDiscoveryImpl) getDeadMembers() []common.PKIidType {
719719
for id, last := range d.aliveLastTS {
720720
elapsedNonAliveTime := time.Since(last.lastSeen)
721721
if elapsedNonAliveTime.Nanoseconds() > getAliveExpirationTimeout().Nanoseconds() {
722-
d.logger.Warning("Haven't heard from", id, "for", elapsedNonAliveTime)
722+
d.logger.Warning("Haven't heard from", []byte(id), "for", elapsedNonAliveTime)
723723
dead = append(dead, common.PKIidType(id))
724724
}
725725
}

gossip/gossip/gossip_impl.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ func (sa *discoverySecurityAdapter) ValidateAliveMsg(m *proto.SignedGossipMessag
935935
}
936936

937937
if identity == nil {
938-
sa.logger.Warning("Don't have certificate for", am)
938+
sa.logger.Debug("Don't have certificate for", am)
939939
return false
940940
}
941941

0 commit comments

Comments
 (0)