Skip to content

Commit

Permalink
Fix the thread-unsafe of PeerState logging (Finschia#458)
Browse files Browse the repository at this point in the history
* Fix the thread-unsafe of PeerState logging

* Add the modification information

(cherry picked from commit 38e64c8)
  • Loading branch information
tnasu authored and zemyblue committed Sep 2, 2022
1 parent 2231684 commit c90fbc4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion consensus/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,11 @@ func (ps *PeerState) SetHasProposalBlockPart(height int64, round int32, index in
func (ps *PeerState) PickSendVote(votes types.VoteSetReader) bool {
if vote, ok := ps.PickVoteToSend(votes); ok {
msg := &VoteMessage{vote}
ps.logger.Debug("Sending vote message", "ps", ps, "vote", vote)
// Remove the logging `PeerState`
// See: https://github.com/line/ostracon/issues/457
// See: https://github.com/tendermint/tendermint/discussions/9353
// ps.logger.Debug("Sending vote message", "ps", ps, "vote", vote)
ps.logger.Debug("Sending vote message", "vote", vote)
if ps.peer.Send(VoteChannel, MustEncode(msg)) {
ps.SetHasVote(vote)
return true
Expand Down

0 comments on commit c90fbc4

Please sign in to comment.