Skip to content

Commit ccc4ef8

Browse files
committed
[FAB-4118] Do not log PullResponse content
The pull response might contain a huge amount of data since it contains blocks. We shouldn't print it, but instead just print the amount of items in the response. Change-Id: I74df07bb776d3beb45480579c4ecd8cb0df9f849 Signed-off-by: Yacov Manevich <[email protected]>
1 parent c520e53 commit ccc4ef8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

gossip/gossip/pull/pullstore.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ func (p *pullMediatorImpl) HandleMessage(m proto.ReceivedMessage) {
154154
return
155155
}
156156
msg := m.GetGossipMessage()
157-
158157
msgType := msg.GetPullMsgType()
159158
if msgType != p.config.MsgType {
160159
return
@@ -262,7 +261,7 @@ func (p *pullMediatorImpl) Hello(dest string, nonce uint64) {
262261
},
263262
}
264263

265-
p.logger.Debug("Sending hello to", dest)
264+
p.logger.Debug("Sending", p.config.MsgType, "hello to", dest)
266265
p.Sndr.Send(helloMsg.NoopSign(), p.peersWithEndpoints(dest)...)
267266
}
268267

@@ -281,7 +280,8 @@ func (p *pullMediatorImpl) SendDigest(digest []string, nonce uint64, context int
281280
},
282281
},
283282
}
284-
p.logger.Debug("Sending digest", digMsg.GetDataDig().Digests)
283+
remotePeer := context.(proto.ReceivedMessage).GetConnectionInfo()
284+
p.logger.Debug("Sending", p.config.MsgType, "digest:", digMsg.GetDataDig().Digests, "to", remotePeer)
285285
context.(proto.ReceivedMessage).Respond(digMsg)
286286
}
287287

@@ -327,7 +327,8 @@ func (p *pullMediatorImpl) SendRes(items []string, context interface{}, nonce ui
327327
},
328328
},
329329
}
330-
p.logger.Debug("Sending", returnedUpdate, "to")
330+
remotePeer := context.(proto.ReceivedMessage).GetConnectionInfo()
331+
p.logger.Debug("Sending", len(returnedUpdate.GetDataUpdate().Data), p.config.MsgType, "items to", remotePeer)
331332
context.(proto.ReceivedMessage).Respond(returnedUpdate)
332333
}
333334

0 commit comments

Comments
 (0)