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

mani 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 2113cd7e [YUNIKORN-3004] Lock User Trackers and Group Trackers map 
during delete operations (#1007)
2113cd7e is described below

commit 2113cd7e439c840330db313901d8f7855ab3b532
Author: Manikandan R <[email protected]>
AuthorDate: Sat Dec 21 14:19:40 2024 +0530

    [YUNIKORN-3004] Lock User Trackers and Group Trackers map during delete 
operations (#1007)
    
    Closes: #1007
    
    Signed-off-by: Manikandan R <[email protected]>
---
 pkg/scheduler/ugm/manager.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pkg/scheduler/ugm/manager.go b/pkg/scheduler/ugm/manager.go
index e235f36b..b7d7475b 100644
--- a/pkg/scheduler/ugm/manager.go
+++ b/pkg/scheduler/ugm/manager.go
@@ -159,7 +159,9 @@ func (m *Manager) DecreaseTrackedResource(queuePath, 
applicationID string, usage
        if userTracker.decreaseTrackedResource(queuePath, applicationID, usage, 
removeApp) {
                log.Log(log.SchedUGM).Info("Removing user from manager",
                        zap.String("user", user.User))
+               m.Lock()
                delete(m.userTrackers, user.User)
+               m.Unlock()
        }
        // if the app did not have a group we're done otherwise update the 
groupTracker
        if appGroup == common.Empty {
@@ -184,7 +186,9 @@ func (m *Manager) DecreaseTrackedResource(queuePath, 
applicationID string, usage
                        zap.String("queue path", queuePath),
                        zap.String("application", applicationID),
                        zap.Bool("removeApp", removeApp))
+               m.Lock()
                delete(m.groupTrackers, appGroup)
+               m.Unlock()
        }
 }
 


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

Reply via email to