Skip to content

Commit

Permalink
[FAB-5498] Missing RLock in onStatusChangeFactory
Browse files Browse the repository at this point in the history
There is a map access that isn't protected by a lock
that was introduced in a recent commit.

Change-Id: I31f884f76aaf0ba4a6b547c66830d8cd652f3c4e
Signed-off-by: yacovm <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Jul 27, 2017
1 parent f3d0f5c commit 201a814
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gossip/service/gossip_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ func (g *gossipServiceImpl) onStatusChangeFactory(chainID string, committer bloc
return func(isLeader bool) {
if isLeader {
yield := func() {
g.lock.RLock()
le := g.leaderElection[chainID]
g.lock.RUnlock()
le.Yield()
}
logger.Info("Elected as a leader, starting delivery service for channel", chainID)
Expand Down

0 comments on commit 201a814

Please sign in to comment.