Skip to content

Commit

Permalink
[YUNIKORN-3004] Lock User Trackers and Group Trackers map during dele…
Browse files Browse the repository at this point in the history
…te operations (#1007)

Closes: #1007

Signed-off-by: Manikandan R <[email protected]>
  • Loading branch information
manirajv06 committed Dec 21, 2024
1 parent 72a2553 commit 2113cd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/scheduler/ugm/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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()
}
}

Expand Down

0 comments on commit 2113cd7

Please sign in to comment.