serialize queueMRFHeal(), add timeouts and avoid normal build-ups (#17886)

we expect a certain level of IOPs and latency so this is okay.

fixes other miscellaneous bugs

- such as hanging on mrfCh <- when the context is canceled
- queuing MRF heal when the context is canceled
- remove unused saveStateCh channel
This commit is contained in:
Harshavardhana
2023-08-21 16:44:50 -07:00
committed by GitHub
parent 3a0125fa1f
commit 1c5af7c31a
2 changed files with 41 additions and 57 deletions

View File

@@ -1520,15 +1520,14 @@ func (sys *NotificationSys) GetReplicationMRF(ctx context.Context, bucket, node
select {
case <-ctx.Done():
return err
default:
mrfCh <- e
case mrfCh <- e:
}
}
return nil
}(mrfCh)
go func(wg *sync.WaitGroup) {
wg.Wait()
defer close(mrfCh)
close(mrfCh)
}(&wg)
return mrfCh, nil
}