Merge pull request #23210 from rsc/master

Auto commit by PR queue bot
pull/6/head
k8s-merge-robot 2016-03-18 21:31:54 -07:00
commit 4be9587b43
1 changed files with 3 additions and 1 deletions

View File

@ -502,9 +502,11 @@ func (c *cacheWatcher) stop() {
} }
func (c *cacheWatcher) add(event watchCacheEvent) { func (c *cacheWatcher) add(event watchCacheEvent) {
t := time.NewTimer(5 * time.Second)
defer t.Stop()
select { select {
case c.input <- event: case c.input <- event:
case <-time.After(5 * time.Second): case <-t.C:
// This means that we couldn't send event to that watcher. // This means that we couldn't send event to that watcher.
// Since we don't want to blockin on it infinitely, // Since we don't want to blockin on it infinitely,
// we simply terminate it. // we simply terminate it.