Skip to content

Commit 46b040c

Browse files
committed
clone the map on load
1 parent b456679 commit 46b040c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/verifier/worker_tracker.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"time"
55

66
"github.com/10gen/migration-verifier/msync"
7+
"golang.org/x/exp/maps"
78
)
89

910
// WorkerTracker holds certain data points about each worker thread
@@ -64,7 +65,7 @@ func (wt *WorkerTracker) Unset(workerNum int) {
6465
func (wt *WorkerTracker) Load() WorkerStatusMap {
6566
var wtmap WorkerStatusMap
6667
wt.guard.Load(func(m map[int]WorkerStatus) {
67-
wtmap = m
68+
wtmap = maps.Clone(m)
6869
})
6970

7071
return wtmap

0 commit comments

Comments
 (0)