From 91816215f8ca9173e94ef5e810ccff385819fbd8 Mon Sep 17 00:00:00 2001 From: YUN SUN Date: Thu, 29 Aug 2024 10:38:59 -0500 Subject: [PATCH] [YUNIKORN-2452] node.go#GetAvailableResource ought to use read-lock instead of readwrite-lock --- pkg/scheduler/objects/node.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/scheduler/objects/node.go b/pkg/scheduler/objects/node.go index fcce3c7fb..86d8edba3 100644 --- a/pkg/scheduler/objects/node.go +++ b/pkg/scheduler/objects/node.go @@ -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() }