Skip to content

Commit d829851

Browse files
committed
[FAB-2944]: Make leadership callback synchronous
In order to make leader election test consistent and not to fail this commit makes switching leadership state synchronous. Change-Id: Ie04155bd089f0e7e8553bca9df33e14e0d332817 Signed-off-by: Artem Barger <[email protected]>
1 parent 4e5f45c commit d829851

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gossip/election/election.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,13 @@ func (le *leaderElectionSvcImpl) IsLeader() bool {
361361
func (le *leaderElectionSvcImpl) beLeader() {
362362
le.logger.Debug(le.id, ": Becoming a leader")
363363
atomic.StoreInt32(&le.isLeader, int32(1))
364-
go le.callback(true)
364+
le.callback(true)
365365
}
366366

367367
func (le *leaderElectionSvcImpl) stopBeingLeader() {
368368
le.logger.Debug(le.id, "Stopped being a leader")
369369
atomic.StoreInt32(&le.isLeader, int32(0))
370-
go le.callback(false)
370+
le.callback(false)
371371
}
372372

373373
func (le *leaderElectionSvcImpl) shouldStop() bool {

0 commit comments

Comments
 (0)