pkg/watch: fix potential deadlock

I'm not sure it's actually a problem in the application, but I noticed a potential deadlock scenario with watch.Mux.  If a watcher stops reading from its ResultChan and calls Stop, the Mux could be locked in the distribute method attempting to send a new watch.Event to the watcher that's now no longer watching.
Hmm. I just had an idea. Make two watchers and receive on both of them in a
single select. Then when one gets an event, Stop the other one.
On Sep 15, 2014 6:24 PM, "Daniel Smith" <notifications@github.com> wrote:

> In pkg/watch/mux.go:
>
> > @@ -114,20 +115,28 @@ func (m *Mux) loop() {
> >  	m.closeAll()
> >  }
> >
> > +var testHookMuxDistribute = func() {}
>
> Oh, I see, if you do that then you have no way of knowing if it's even
> tried to distribute a message yet.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleCloudPlatform/kubernetes/pull/1321/files#r17579206>
> .
>