nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Stopped periodic batch job clutters job list

Open EtienneBruines opened this issue 4 years ago • 3 comments
trafficstars

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

  1. Create a batch job that runs periodically, let's say every 1 minute
  2. Let that job run a few times (e.g. wait 5 minutes)
  3. Go into the UI and press Stop for that job (not for the allocation, but for the job itself)
  4. Wait a few minutes (?)
  5. 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

Screenshot_20211004_105954

The cli nomad job status shows the same.

Job file (if appropriate)

Nomad Server logs (if appropriate)

Nomad Client logs (if appropriate)

EtienneBruines avatar Oct 04 '21 09:10 EtienneBruines

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 avatar Oct 06 '21 11:10 jrasell

@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?

EtienneBruines avatar Oct 06 '21 11:10 EtienneBruines

Thanks for the clarification @EtienneBruines. This does seem like undesirable/unexpected behaviour and i'll mark this for our UI experts to investigate further.

jrasell avatar Oct 06 '21 12:10 jrasell

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

philrenaud avatar Jun 03 '24 20:06 philrenaud