Skip to content

Commit

Permalink
Fixing possible race with the logger in send
Browse files Browse the repository at this point in the history
  • Loading branch information
AnomalRoil committed Mar 30, 2022
1 parent c9621e8 commit f51b8cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chain/beacon/sync_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ func SyncChain(l log.Logger, store CallbackStore, req SyncRequest, stream SyncSt
}

var done = make(chan error, 1)
logger := l.Named("Send")
send := func(b *chain.Beacon) bool {
if err := stream.Send(beaconToProto(b)); err != nil {
l.Debug("syncer", "streaming_send", "err", err)
logger.Debug("syncer", "streaming_send", "err", err)
done <- err
return false
}
Expand Down

0 comments on commit f51b8cc

Please sign in to comment.