20457: Log at info level when flapping lock at concurrency limit.
[arvados.git] / lib / dispatchcloud / scheduler / run_queue.go
index 1e5ac2e0466b97730d5eccc9620134d021a66c20..dda3630ee7b88c6888b8eb2d1ba7db4735ebdd74 100644 (file)
@@ -84,6 +84,8 @@ func (sch *Scheduler) runQueue() {
        // reaches the dynamic maxConcurrency limit.
        trying := len(running)
 
+       supervisors := 0
+
 tryrun:
        for i, ctr := range sorted {
                ctr, it := ctr.Container, ctr.InstanceType
@@ -91,6 +93,12 @@ tryrun:
                        "ContainerUUID": ctr.UUID,
                        "InstanceType":  it.Name,
                })
+               if ctr.SchedulingParameters.Supervisor {
+                       supervisors += 1
+                       if sch.maxSupervisors > 0 && supervisors > sch.maxSupervisors {
+                               continue
+                       }
+               }
                if _, running := running[ctr.UUID]; running || ctr.Priority < 1 {
                        continue
                }
@@ -177,7 +185,7 @@ tryrun:
                        _, toolate := running[ctr.UUID]
                        if ctr.State == arvados.ContainerStateLocked && !toolate {
                                logger := sch.logger.WithField("ContainerUUID", ctr.UUID)
-                               logger.Debug("unlock because pool capacity is used by higher priority containers")
+                               logger.Info("unlock because pool capacity is used by higher priority containers")
                                err := sch.queue.Unlock(ctr.UUID)
                                if err != nil {
                                        logger.WithError(err).Warn("error unlocking")