mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcd-runner: fix race on nextc
This commit is contained in:
@@ -129,8 +129,10 @@ func runElectionFunc(cmd *cobra.Command, args []string) {
|
||||
return err
|
||||
}
|
||||
if observedLeader == v {
|
||||
close(nextc)
|
||||
oldNextc := nextc
|
||||
nextc = make(chan struct{})
|
||||
close(oldNextc)
|
||||
|
||||
}
|
||||
<-rcNextc
|
||||
observedLeader = ""
|
||||
|
||||
Reference in New Issue
Block a user