Skip to content

Commit

Permalink
[YUNIKORN-2452] Use RLock() for node.GetAvailableResource() (#958)
Browse files Browse the repository at this point in the history
Closes: #958

Signed-off-by: Craig Condit <[email protected]>
  • Loading branch information
SophieTech88 authored and craigcondit committed Aug 29, 2024
1 parent 6939b13 commit 961b96f
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 961b96f

Please sign in to comment.