Skip to content

Commit cd19bbf

Browse files
authored
Schedule dequeuer first and then user provided containers for BatchAPI (#2218)
1 parent 8a9a9a6 commit cd19bbf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/workloads/k8s.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,12 @@ func TaskContainers(api spec.API, job *spec.JobKey) ([]kcore.Container, []kcore.
293293
}
294294

295295
func BatchContainers(api spec.API, job *spec.BatchJob) ([]kcore.Container, []kcore.Volume) {
296-
containers, volumes := userPodContainers(api)
296+
userContainers, userVolumes := userPodContainers(api)
297297
dequeuerContainer, dequeuerVolume := batchDequeuerProxyContainer(api, job.ID, job.SQSUrl)
298298

299-
containers = append(containers, dequeuerContainer)
300-
volumes = append(volumes, dequeuerVolume)
299+
// make sure the dequeuer starts first to allow it to start watching the graveyard before user containers begin
300+
containers := append([]kcore.Container{dequeuerContainer}, userContainers...)
301+
volumes := append([]kcore.Volume{dequeuerVolume}, userVolumes...)
301302

302303
k8sName := job.K8sName()
303304

0 commit comments

Comments
 (0)