chia7712 commented on code in PR #810:
URL: https://github.com/apache/yunikorn-core/pull/810#discussion_r1553804808
##########
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:
Maybe we should move this log info to
`group_tracker#increaseTrackedResource` for consistency?
--
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]