mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-06 01:20:40 +00:00
reflector: fallback to the previous mode on any error
originally we honored only apierrors.IsInvalid but decided to fallback on every error because it is better to make progress than deadlocking Kubernetes-commit: 4b3915017950a114124a88c5d308bd8bfb9ec48e
This commit is contained in:
committed by
Kubernetes Publisher
parent
fbb1575728
commit
1e0855a7ac
7
tools/cache/reflector.go
vendored
7
tools/cache/reflector.go
vendored
@@ -334,12 +334,9 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
if !apierrors.IsInvalid(err) {
|
||||
return err
|
||||
}
|
||||
klog.Warning("The watch-list feature is not supported by the server, falling back to the previous LIST/WATCH semantics")
|
||||
klog.Warningf("The watchlist request ended with an error, falling back to the standard LIST/WATCH semantics because making progress is better than deadlocking, err = %v", err)
|
||||
fallbackToList = true
|
||||
// Ensure that we won't accidentally pass some garbage down the watch.
|
||||
// ensure that we won't accidentally pass some garbage down the watch.
|
||||
w = nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user