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
1 changed files with 1 additions and 0 deletions

View File

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