pbacsko commented on code in PR #810:
URL: https://github.com/apache/yunikorn-core/pull/810#discussion_r1554027774
##########
pkg/scheduler/ugm/user_tracker.go:
##########
@@ -56,35 +56,22 @@ func newUserTracker(userName string, ugmEvents *ugmEvents)
*UserTracker {
return userTracker
}
-func (ut *UserTracker) increaseTrackedResource(queuePath string, applicationID
string, usage *resources.Resource) bool {
+func (ut *UserTracker) increaseTrackedResource(queuePath string, applicationID
string, usage *resources.Resource) {
ut.Lock()
defer ut.Unlock()
- hierarchy := strings.Split(queuePath, configs.DOT)
ut.events.sendIncResourceUsageForUser(ut.userName, queuePath, usage)
- increased := ut.queueTracker.increaseTrackedResource(hierarchy,
applicationID, user, usage)
- if increased {
- gt := ut.appGroupTrackers[applicationID]
- log.Log(log.SchedUGM).Debug("Increasing resource usage for
group",
- zap.String("group", gt.getName()),
- zap.String("queue path", queuePath),
- zap.String("application", applicationID),
- zap.Stringer("resource", usage))
- increasedGroupUsage := gt.increaseTrackedResource(queuePath,
applicationID, usage, ut.userName)
- if !increasedGroupUsage {
- _, decreased :=
ut.queueTracker.decreaseTrackedResource(hierarchy, applicationID, usage, false)
- if !decreased {
- log.Log(log.SchedUGM).Error("User resource
usage rollback has failed",
- zap.String("queue path", queuePath),
- zap.String("application",
applicationID),
- zap.String("user", ut.userName))
- }
- }
- return increasedGroupUsage
- }
- return increased
+ hierarchy := strings.Split(queuePath, configs.DOT)
+ ut.queueTracker.increaseTrackedResource(hierarchy, applicationID, user,
usage)
+ gt := ut.appGroupTrackers[applicationID]
+ log.Log(log.SchedUGM).Debug("Increasing resource usage for group",
Review Comment:
Logging and GroupTracker handling is a bit all over the place. Created
https://issues.apache.org/jira/browse/YUNIKORN-2542 as a follow-up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]