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:
parent
87d99fe038
commit
b44bd6d2a9
@ -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 = ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user