Skip to content

Commit

Permalink
fix infinite loop in mux dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Nov 4, 2018
1 parent fcce267 commit db6d6a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/mux/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit db6d6a8

Please sign in to comment.