sch.maxConcurrency = max
}
}
- sch.mLast503Time.Set(float64(sch.last503time.Unix()))
+ if sch.last503time.IsZero() {
+ sch.mLast503Time.Set(0)
+ } else {
+ sch.mLast503Time.Set(float64(sch.last503time.Unix()))
+ }
sch.mMaxContainerConcurrency.Set(float64(sch.maxConcurrency))
sch.logger.WithFields(logrus.Fields{
// reaches the dynamic maxConcurrency limit.
trying := len(running)
+ supervisors := 0
+
tryrun:
for i, ctr := range sorted {
ctr, it := ctr.Container, ctr.InstanceType
"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
}
} else if sch.pool.KillContainer(ctr.UUID, "about to start") {
logger.Info("not restarting yet: crunch-run process from previous attempt has not exited")
} else if sch.pool.StartContainer(it, ctr) {
+ logger.Trace("StartContainer => true")
// Success.
} else {
+ logger.Trace("StartContainer => false")
containerAllocatedWorkerBootingCount += 1
dontstart[it] = true
}