tests: Protect globalLocalDrives against races (#16800)

This commit is contained in:
Klaus Post
2023-03-13 06:04:20 -07:00
committed by GitHub
parent cde7eeb660
commit 628042e65e
4 changed files with 25 additions and 2 deletions

View File

@@ -271,6 +271,9 @@ func initAutoHeal(ctx context.Context, objAPI ObjectLayer) {
}
func getLocalDisksToHeal() (disksToHeal Endpoints) {
globalLocalDrivesMu.RLock()
globalLocalDrives := globalLocalDrives
globalLocalDrivesMu.RUnlock()
for _, disk := range globalLocalDrives {
_, err := disk.GetDiskID()
if errors.Is(err, errUnformattedDisk) {