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:
Clayton Coleman
2014-12-18 15:38:24 -05:00
parent af571a239e
commit b2434de777
5 changed files with 103 additions and 1 deletions

View File

@@ -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)