Skip to content

Commit

Permalink
Merge pull request #1941 from huone1/numa-aware/map-bugfix
Browse files Browse the repository at this point in the history
[numa-aware]fix concurrent map read and map write
  • Loading branch information
volcano-sh-bot authored Jan 11, 2022
2 parents 0c62e0c + 4a1f8a6 commit 2a45ed2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/scheduler/plugins/numaaware/numaaware.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const (
)

type numaPlugin struct {
sync.Mutex
// Arguments given for the plugin
pluginArguments framework.Arguments
hintProviders []policy.HintProvider
Expand Down Expand Up @@ -142,6 +143,8 @@ func (pp *numaPlugin) OnSessionOpen(ssn *framework.Session) {
}
}

pp.Lock()
defer pp.Unlock()
if _, ok := pp.assignRes[task.UID]; !ok {
pp.assignRes[task.UID] = make(map[string]api.ResNumaSets)
}
Expand Down

0 comments on commit 2a45ed2

Please sign in to comment.