Fix shared top locks client (#19018)

`client` is shared across goroutines.

Seen with `mc support top locks` on minio built with `-race`.
This commit is contained in:
Klaus Post 2024-02-08 12:28:05 -08:00 committed by GitHub
parent 035a3ea4ae
commit 6005ad3d48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -460,6 +460,7 @@ func (sys *NotificationSys) GetLocks(ctx context.Context, r *http.Request) []*Pe
g := errgroup.WithNErrs(len(sys.peerClients))
for index, client := range sys.peerClients {
index := index
client := client
g.Go(func() error {
if client == nil {
return errPeerNotReachable