Merge pull request #2767 from ironcladlou/watch-error-handling

Log ErrUnexpectedEOF from watches as warnings
This commit is contained in:
bgrant0607
2014-12-05 13:43:26 -08:00
2 changed files with 16 additions and 3 deletions

View File

@@ -84,7 +84,12 @@ func (sw *StreamWatcher) receive() {
for {
action, obj, err := sw.source.Decode()
if err != nil {
if err != io.EOF {
switch err {
case io.EOF:
// watch closed normally
case io.ErrUnexpectedEOF:
glog.V(1).Infof("Unexpected EOF during watch stream event decoding: %v", err)
default:
glog.Errorf("Unable to decode an event from the watch stream: %v", err)
}
return