From db6d6a89df7ebf2899b42e5ecedf5d79779f591a Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sun, 4 Nov 2018 08:59:34 +0100 Subject: [PATCH] fix infinite loop in mux dispatch --- common/mux/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/mux/client.go b/common/mux/client.go index 2fd2ee8c..81aa3b5c 100644 --- a/common/mux/client.go +++ b/common/mux/client.go @@ -25,7 +25,7 @@ type ClientManager struct { } func (m *ClientManager) Dispatch(ctx context.Context, link *transport.Link) error { - for { + for i := 0; i < 16; i++ { worker, err := m.Picker.PickAvailable() if err != nil { return err @@ -34,6 +34,8 @@ func (m *ClientManager) Dispatch(ctx context.Context, link *transport.Link) erro return nil } } + + return newError("unable to find an available mux client") } type WorkerPicker interface {