This is an automated email from the ASF dual-hosted git repository.

ccondit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 961b96f9 [YUNIKORN-2452] Use RLock() for node.GetAvailableResource() 
(#958)
961b96f9 is described below

commit 961b96f94e6463049e79d88a4377352870ce5c36
Author: YUN SUN <[email protected]>
AuthorDate: Thu Aug 29 13:10:14 2024 -0500

    [YUNIKORN-2452] Use RLock() for node.GetAvailableResource() (#958)
    
    Closes: #958
    
    Signed-off-by: Craig Condit <[email protected]>
---
 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 fcce3c7f..86d8edba 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()
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to