Run oldest jobs first

I have a piece of automation (A) that schedules a bunch of jobs every time it is invoked.

Let’s say invocation I1 of A schedules 100 jobs of priority 50.

Before those 100 jobs are completed, we invoke A again (I2), scheduling another 100 jobs of priority 50.

I would have expected that before starting any I2 jobs, all jobs of I1 would complete, but this is not the case.

How can I enforce this?

Please?

Could someone please confirm whether this is expected behavior at least?

Hi @alexboboc,

This is expected behaviour from Nomad as it is evaluating the pending jobs in priority order.

Enforcing your requirement is tricky and depends on exactly how often this group of jobs are submitted. In the event it is a small number of times, you could potentially alter the priority on each successive substation during a time period to ensure the current group finishes interrupted.

Are you able to share more information on what the jobs are doing and the rational behind the way they are submitted?

Thanks,
jrasell and the Nomad team

Thanks for your response @jrasell!

The idea behind these jobs is as follows:

  • When a given event happens, some processing is needed to satisfy a user’s request.
  • This processing needs to be broken down across a variable number of jobs.
  • When the event is triggered, a piece of logic schedules n jobs for this request.
  • I want to finish all jobs of a request before moving on to the next one, otherwise, the whole processing time per request is much longer than strictly needed.

I hope this makes sense and helps shed light on my use case.

Thank you again!