open-nomad/client/allocrunner
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
..
interfaces [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
state [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
tasklifecycle [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
taskrunner full task cleanup when alloc prerun hook fails (#17104) 2023-05-08 13:17:10 -05:00
alloc_runner.go full task cleanup when alloc prerun hook fails (#17104) 2023-05-08 13:17:10 -05:00
alloc_runner_hooks.go full task cleanup when alloc prerun hook fails (#17104) 2023-05-08 13:17:10 -05:00
alloc_runner_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
alloc_runner_unix_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
allocdir_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
cgroup_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
checks_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
checks_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
config.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_grpc_sock_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_grpc_sock_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_http_sock_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_http_sock_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
csi_hook.go Merge pull request #16836 from hashicorp/compliance/add-headers 2023-04-10 16:32:03 -07:00
csi_hook_test.go Merge pull request #16836 from hashicorp/compliance/add-headers 2023-04-10 16:32:03 -07:00
fail_hook.go full task cleanup when alloc prerun hook fails (#17104) 2023-05-08 13:17:10 -05:00
group_service_hook.go services: un-mark group services as deregistered if restart hook runs (#16905) 2023-04-24 14:24:51 -05:00
group_service_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
health_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
health_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
migrate_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
network_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
network_hook_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
network_manager_linux.go allocrunner: prevent panic on network manager (#16921) 2023-04-18 13:39:13 -07:00
network_manager_linux_test.go allocrunner: prevent panic on network manager (#16921) 2023-04-18 13:39:13 -07:00
network_manager_nonlinux.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking_bridge_linux.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking_bridge_linux_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking_cni.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
networking_cni_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
testing.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
upstream_allocs_hook.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00