From e76c0b7c72a81d7e900e341f2c5a48bd26daaddf Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Fri, 19 Aug 2016 11:52:03 +0200 Subject: [PATCH] Increase buffer size in etcd_watcher --- pkg/storage/etcd/etcd_watcher.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkg/storage/etcd/etcd_watcher.go b/pkg/storage/etcd/etcd_watcher.go index e6cbd396967..66251a9159d 100644 --- a/pkg/storage/etcd/etcd_watcher.go +++ b/pkg/storage/etcd/etcd_watcher.go @@ -139,13 +139,15 @@ func newEtcdWatcher( // monitor how much of this buffer is actually used. etcdIncoming: make(chan *etcd.Response, 100), etcdError: make(chan error, 1), - outgoing: make(chan watch.Event), - userStop: make(chan struct{}), - stopped: false, - wg: sync.WaitGroup{}, - cache: cache, - ctx: nil, - cancel: nil, + // Similarly to etcdIncomming, we don't want to force context + // switch on every new incoming object. + outgoing: make(chan watch.Event, 100), + userStop: make(chan struct{}), + stopped: false, + wg: sync.WaitGroup{}, + cache: cache, + ctx: nil, + cancel: nil, } w.emit = func(e watch.Event) { // Give up on user stop, without this we leak a lot of goroutines in tests.