Merge pull request #26085 from smarterclayton/delay_flush

Automatic merge from submit-queue

Delay flush if the watch queue has pending items

Simple deferral of flush can reduce Syscalls when watch queues build up.

Simpler version of #24768

Fixes #24729

@xiang90 @wojtek-t
pull/6/head
k8s-merge-robot 2016-05-28 11:53:51 -07:00
commit ce788c45ef
1 changed files with 3 additions and 1 deletions

View File

@ -203,7 +203,9 @@ func (s *WatchServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// client disconnect.
return
}
flusher.Flush()
if len(ch) == 0 {
flusher.Flush()
}
buf.Reset()
}