Skip to content

Commit

Permalink
[YUNIKORN-2452] node.go#GetAvailableResource ought to use read-lock i…
Browse files Browse the repository at this point in the history
…nstead of readwrite-lock
  • Loading branch information
SophieTech88 committed Aug 29, 2024
1 parent 6939b13 commit 9181621
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/scheduler/objects/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ func (sn *Node) GetAllocatedResource() *resources.Resource {

// Get the available resource on this node.
func (sn *Node) GetAvailableResource() *resources.Resource {
sn.Lock()
defer sn.Unlock()
sn.RLock()
defer sn.RUnlock()
return sn.availableResource.Clone()
}

Expand Down

0 comments on commit 9181621

Please sign in to comment.