mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
Fix data race on cancel variable in etcd code
This commit is contained in:
parent
977854b8de
commit
e3311aa93a
1 changed files with 2 additions and 0 deletions
|
|
@ -158,7 +158,9 @@ func (w *etcdWatcher) etcdWatch(ctx context.Context, client etcd.KeysAPI, key st
|
|||
AfterIndex: resourceVersion,
|
||||
}
|
||||
watcher := client.Watcher(key, &opts)
|
||||
w.stopLock.Lock()
|
||||
w.ctx, w.cancel = context.WithCancel(ctx)
|
||||
w.stopLock.Unlock()
|
||||
|
||||
for {
|
||||
resp, err := watcher.Next(w.ctx)
|
||||
|
|
|
|||
Loading…
Reference in a new issue