mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 19:52:42 +00:00
When connections are broken on Watch, write fewer errors to logs
Watch depends on long running connections, which intervening proxies may break without the control of the remote server. Specific errors handled are io.EOF, io.EOF wrapped by *url.Error, http connection reset errors (caused by race conditions in golang http code), and connection reset by peer (simply tolerated).
This commit is contained in:
2
pkg/client/cache/reflector.go
vendored
2
pkg/client/cache/reflector.go
vendored
@@ -172,7 +172,7 @@ func (r *Reflector) watchHandler(w watch.Interface, resourceVersion *string) err
|
||||
|
||||
watchDuration := time.Now().Sub(start)
|
||||
if watchDuration < 1*time.Second && eventCount == 0 {
|
||||
glog.Errorf("unexpected watch close - watch lasted less than a second and no items received")
|
||||
glog.V(4).Infof("Unexpected watch close - watch lasted less than a second and no items received")
|
||||
return errors.New("very short watch")
|
||||
}
|
||||
glog.V(4).Infof("Watch close - %v total %v items received", r.expectedType, eventCount)
|
||||
|
Reference in New Issue
Block a user