nomad
nomad copied to clipboard
Stopped periodic batch job clutters job list
Nomad version
Nomad v1.1.5 (117a23d2cdf26a1837b21c84f30c8c0f3441e927)
Operating system and Environment details
Server runs Ubuntu 20.04.3 LTS
Issue
After stopping a periodic batch job, the jobs listing is cluttered.
Reproduction steps
- Create a batch job that runs periodically, let's say every 1 minute
- Let that job run a few times (e.g. wait 5 minutes)
- Go into the UI and press
Stopfor that job (not for the allocation, but for the job itself) - Wait a few minutes (?)
- Go into the list of jobs and verify that the job is stopped / dead.
Possibly important: the job is in the non-default namespace.
Expected Result
Not to see a list of all allocations/invocations/evaluations (?) of that stopped job.
Actual Result

The cli nomad job status shows the same.
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
Hi @EtienneBruines. The objects from a stopped job are not removed from Nomad state until the job_gc_threshold has been reached. Until that time, the objects, as you described are still visible.
When stopping a job via the CLI or API, it is possible to specify a purge parameter which stops the job and immediately garbage collects its information. I wonder if we should therefore make this setting available via the UI?
@jrasell They weren't visible to begin with, though. They only appeared as I removed the job mossaino-certificate-udpatear itself. I can imagine that previously, they were "grouped" under that job, and when I stopped that job, they all appeared individually?
Thanks for the clarification @EtienneBruines. This does seem like undesirable/unexpected behaviour and i'll mark this for our UI experts to investigate further.
Hi and thank you for your patience on this issue! The jobs index page will no longer be cluttered by child jobs, as they're no longer fetched until a parent job is clicked-into in the UI. This work went out in v1.8 and details can be found at https://github.com/hashicorp/nomad/pull/20452