15707: Fix "on hold" containers not dropped from queue.
authorTom Clegg <tclegg@veritasgenetics.com>
Tue, 19 Nov 2019 21:25:48 +0000 (16:25 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Tue, 19 Nov 2019 21:25:48 +0000 (16:25 -0500)
refs #15707

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

lib/dispatchcloud/container/queue.go
lib/dispatchcloud/scheduler/sync.go

index 50e73189efbc854433f8713e0a7762efafc0fe70..f999ee80ad49b7d2801307362255822e6430fd1f 100644 (file)
@@ -133,7 +133,7 @@ func (cq *Queue) Forget(uuid string) {
        cq.mtx.Lock()
        defer cq.mtx.Unlock()
        ctr := cq.current[uuid].Container
-       if ctr.State == arvados.ContainerStateComplete || ctr.State == arvados.ContainerStateCancelled {
+       if ctr.State == arvados.ContainerStateComplete || ctr.State == arvados.ContainerStateCancelled || (ctr.State == arvados.ContainerStateQueued && ctr.Priority == 0) {
                cq.delEnt(uuid, ctr.State)
        }
 }
index 205ee5018710a47749e276f73985ceb3b1b1af01..e306db00ceacbdbf5fe35bdcece9d9673069a1c8 100644 (file)
@@ -51,7 +51,7 @@ func (sch *Scheduler) sync() {
                                sch.logger.WithFields(logrus.Fields{
                                        "ContainerUUID": uuid,
                                        "State":         ent.Container.State,
-                               }).Info("container finished")
+                               }).Info("container finished -- dropping from queue")
                                sch.queue.Forget(uuid)
                        }
                case arvados.ContainerStateQueued:
@@ -66,7 +66,7 @@ func (sch *Scheduler) sync() {
                                        "ContainerUUID": uuid,
                                        "State":         ent.Container.State,
                                        "Priority":      ent.Container.Priority,
-                               }).Info("container on hold")
+                               }).Info("container on hold -- dropping from queue")
                                sch.queue.Forget(uuid)
                        }
                case arvados.ContainerStateLocked: