Fix stats fetcher healthcheck RPCs not being independent
This commit is contained in:
parent
1afcabb0a2
commit
aa19559cc7
|
@ -92,6 +92,14 @@ func (f *StatsFetcher) Fetch(ctx context.Context, members []serf.Member) map[str
|
||||||
// canceled.
|
// canceled.
|
||||||
replies := make(map[string]*autopilot.ServerStats)
|
replies := make(map[string]*autopilot.ServerStats)
|
||||||
for _, workItem := range work {
|
for _, workItem := range work {
|
||||||
|
// Drain the reply first if there is one.
|
||||||
|
select {
|
||||||
|
case reply := <-workItem.replyCh:
|
||||||
|
replies[workItem.server.ID] = reply
|
||||||
|
continue
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case reply := <-workItem.replyCh:
|
case reply := <-workItem.replyCh:
|
||||||
replies[workItem.server.ID] = reply
|
replies[workItem.server.ID] = reply
|
||||||
|
|
Loading…
Reference in New Issue