Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-2683

Unnecessary error is logged when resource usage is increased

    XMLWordPrintableJSON

Details

    Description

      The refactored code in YUNIKORN-2542 contains an unnecessary warning message:

      	appGroup := userTracker.getGroupForApp(applicationID)
      	log.Log(log.SchedUGM).Debug("Increasing resource usage for user",
      		zap.String("user", user.User),
      		zap.String("queue path", queuePath),
      		zap.String("application", applicationID),
      		zap.String("group", appGroup),
      		zap.Stringer("resource", usage))
      	groupTracker := m.GetGroupTracker(appGroup)
      	if groupTracker == nil {
      		log.Log(log.SchedUGM).Error("group tracker should be available in groupTrackers map",
      		zap.String("application", applicationID),
      		zap.String("group", appGroup))
      		return
      	}
      ...
      

      We don't always have a groupTracker. The previous code simply called increaseTrackedResource() on an empty tracker:

      func (ut *UserTracker) increaseTrackedResource(queuePath string, applicationID string, usage *resources.Resource) {
      	ut.Lock()
      	defer ut.Unlock()
      	ut.events.sendIncResourceUsageForUser(ut.userName, queuePath, usage)
      	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",
      		zap.String("group", gt.getName()),
      		zap.Strings("queue path", hierarchy),
      		zap.String("application", applicationID),
      		zap.Stringer("resource", usage))
      	gt.increaseTrackedResource(queuePath, applicationID, usage, ut.userName) <- can be null
      }
      

      Attachments

        Issue Links

          Activity

            People

              pbacsko Peter Bacsko
              pbacsko Peter Bacsko
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: