Commit d3639aff authored by Wojciech Tyczynski's avatar Wojciech Tyczynski

Fix deadlock in watch cache

parent 2e7993e0
......@@ -220,13 +220,13 @@ func (w *watchCache) WaitUntilFreshAndList(resourceVersion uint64) ([]interface{
}()
w.RLock()
defer w.RUnlock()
for w.resourceVersion < resourceVersion {
if w.clock.Since(startTime) >= MaximumListWait {
return nil, 0, fmt.Errorf("time limit exceeded while waiting for resource version %v (current value: %v)", resourceVersion, w.resourceVersion)
}
w.cond.Wait()
}
defer w.RUnlock()
return w.store.List(), w.resourceVersion, nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment