Skip to content

Commit

Permalink
[YUNIKORN-2907] Queue config processing log spew
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael committed Dec 26, 2024
1 parent a351764 commit 64eed25
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
24 changes: 21 additions & 3 deletions pkg/scheduler/objects/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,29 @@ func newBlankQueue() *Queue {
}
}

// NewConfiguredQueue creates a new queue from scratch based on the configuration
// NewConfiguredQueue creates a new queue from scratch based on the configuration and logs at info level
// lock free as it cannot be referenced yet
func NewConfiguredQueue(conf configs.QueueConfig, parent *Queue) (*Queue, error) {
queue, err := newConfiguredQueueInternal(conf, parent)
if queue != nil {
log.Log(log.SchedQueue).Info("configured queue added to scheduler",
zap.String("queueName", queue.QueuePath))
}
return queue, err
}

// NewConfiguredShadowQueue creates a new queue from scratch based on the configuration and logs at debug level
// lock free as it cannot be referenced yet
func NewConfiguredShadowQueue(conf configs.QueueConfig, parent *Queue) (*Queue, error) {
queue, err := newConfiguredQueueInternal(conf, parent)
if queue != nil {
log.Log(log.SchedQueue).Debug("shadow queue created",
zap.String("queueName", queue.QueuePath))
}
return queue, err

Check warning on line 135 in pkg/scheduler/objects/queue.go

View check run for this annotation

Codecov / codecov/patch

pkg/scheduler/objects/queue.go#L129-L135

Added lines #L129 - L135 were not covered by tests
}

func newConfiguredQueueInternal(conf configs.QueueConfig, parent *Queue) (*Queue, error) {
sq := newBlankQueue()
sq.Name = strings.ToLower(conf.Name)
sq.QueuePath = strings.ToLower(conf.Name)
Expand Down Expand Up @@ -145,8 +165,6 @@ func NewConfiguredQueue(conf configs.QueueConfig, parent *Queue) (*Queue, error)
sq.UpdateQueueProperties()
}
sq.queueEvents = schedEvt.NewQueueEvents(events.GetEventSystem())
log.Log(log.SchedQueue).Info("configured queue added to scheduler",
zap.String("queueName", sq.QueuePath))
sq.queueEvents.SendNewQueueEvent(sq.QueuePath, sq.isManaged)

return sq, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (pc *PartitionContext) updateQueues(config []configs.QueueConfig, parent *o
queue := pc.getQueueInternal(pathName)
var err error
if queue == nil {
queue, err = objects.NewConfiguredQueue(queueConfig, parent)
queue, err = objects.NewConfiguredShadowQueue(queueConfig, parent)
} else {
err = queue.ApplyConf(queueConfig)
}
Expand Down

0 comments on commit 64eed25

Please sign in to comment.