mirror of
https://github.com/minio/minio.git
synced 2025-10-29 15:55:00 -04:00
race: Fix rare race detected by testing (#19872)
Below is the race warning:
```
WARNING: DATA RACE
Write at 0x00c02d3d27c0 by goroutine 1210:
github.com/minio/minio/cmd.(*healingTracker).bucketDone()
github.com/minio/minio/cmd/background-newdisks-heal-ops.go:273 +0x13a
github.com/minio/minio/cmd.(*erasureObjects).healErasureSet()
github.com/minio/minio/cmd/global-heal.go:525 +0x2158
github.com/minio/minio/cmd.healFreshDisk()
github.com/minio/minio/cmd/background-newdisks-heal-ops.go:450 +0x107e
github.com/minio/minio/cmd.monitorLocalDisksAndHeal.func1()
github.com/minio/minio/cmd/background-newdisks-heal-ops.go:528 +0x150
github.com/minio/minio/cmd.monitorLocalDisksAndHeal.gowrap2()
github.com/minio/minio/cmd/background-newdisks-heal-ops.go:538 +0x82
Previous read at 0x00c02d3d27c0 by goroutine 1446:
github.com/minio/minio/cmd.(*erasureObjects).healErasureSet.func5()
github.com/minio/minio/cmd/global-heal.go:232 +0xfd
```
This commit is contained in:
parent
39ac720826
commit
d274566463
@ -141,14 +141,14 @@ func initHealingTracker(disk StorageAPI, healID string) *healingTracker {
|
||||
return h
|
||||
}
|
||||
|
||||
func (h healingTracker) getLastUpdate() time.Time {
|
||||
func (h *healingTracker) getLastUpdate() time.Time {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
|
||||
return h.LastUpdate
|
||||
}
|
||||
|
||||
func (h healingTracker) getBucket() string {
|
||||
func (h *healingTracker) getBucket() string {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
|
||||
@ -162,7 +162,7 @@ func (h *healingTracker) setBucket(bucket string) {
|
||||
h.Bucket = bucket
|
||||
}
|
||||
|
||||
func (h healingTracker) getObject() string {
|
||||
func (h *healingTracker) getObject() string {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user