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

Fix hard-coded boolean in setLimit

    XMLWordPrintableJSON

Details

    Description

      Inside the UGM code setLimit(), we don't pass down doWildcardCheck, so this variables never reaches the leafs:

      / Note: Lock free call. The Lock of the linked tracker (UserTracker and GroupTracker) should be held before calling this function.
      func (qt *QueueTracker) setLimit(hierarchy []string, maxResource *resources.Resource, maxApps uint64, useWildCard bool, trackType trackingType, doWildCardCheck bool) {
      	log.Log(log.SchedUGM).Debug("Setting limits",
      		zap.String("queue path", qt.queuePath),
      		zap.Strings("hierarchy", hierarchy),
      		zap.Uint64("max applications", maxApps),
      		zap.Stringer("max resources", maxResource),
      		zap.Bool("use wild card", useWildCard))
      	// depth first: all the way to the leaf, create if not exists
      	// more than 1 in the slice means we need to recurse down
      	if len(hierarchy) > 1 {
      		childName := hierarchy[1]
      		if qt.childQueueTrackers[childName] == nil {
      			qt.childQueueTrackers[childName] = newQueueTracker(qt.queuePath, childName, trackType)
      		}
      		qt.childQueueTrackers[childName].setLimit(hierarchy[1:], maxResource, maxApps, useWildCard, trackType, false)  <-- should be "doWildCardCheck" not "false"
      ...
      

      Fix this and create a unit test for setLimit().

      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: