open-nomad/testutil
Daniel Bennett a7ed6f5c53
full task cleanup when alloc prerun hook fails (#17104)
to avoid leaking task resources (e.g. containers,
iptables) if allocRunner prerun fails during
restore on client restart.

now if prerun fails, TaskRunner.MarkFailedKill()
will only emit an event, mark the task as failed,
and cancel the tr's killCtx, so then ar.runTasks()
-> tr.Run() can take care of the actual cleanup.

removed from (formerly) tr.MarkFailedDead(),
now handled by tr.Run():
 * set task state as dead
 * save task runner local state
 * task stop hooks

also done in tr.Run() now that it's not skipped:
 * handleKill() to kill tasks while respecting
   their shutdown delay, and retrying as needed
   * also includes task preKill hooks
 * clearDriverHandle() to destroy the task
   and associated resources
 * task exited hooks
2023-05-08 13:17:10 -05:00
..
responsewriter.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
server.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
tls.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
vault.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
wait.go full task cleanup when alloc prerun hook fails (#17104) 2023-05-08 13:17:10 -05:00
wait_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00