Files
nomad/client
Luiz Aoqui ed204e0fd9 client: ensure task only runs with prestart hooks (#18662)
Since the allocation in the task runner is updated in a separate
goroutine, a race condition may happen where the task is started but the
prestart hooks are skipped because the allocation became terminal.

Checking for a terminal allocation before proceeding with the task start
ensures the task only runs if the prestart hooks are also executed.

Since `shouldShutdown()` only uses terminal allocation status, it
remains `true` after the first transition, so it's safe to check it
again after the prestart hooks as it will never revert to `false`.
2023-10-05 10:16:57 -04:00
..
2023-09-29 17:41:48 +02:00
2023-09-29 17:41:48 +02:00
2023-09-29 17:41:48 +02:00