open-nomad/client/allocrunner/taskrunner
Tim Gross 265e488ab4
task runner: fix goroutine leak in prestart hook (#11741)
The task runner prestart hooks take a `joincontext` so they have the
option to exit early if either of two contexts are canceled: from
killing the task or client shutdown. Some tasks exit without being
shutdown from the server, so neither of the joined contexts ever gets
canceled and we leak the `joincontext` (48 bytes) and its internal
goroutine. This primarily impacts batch jobs and any task that fails
or completes early such as non-sidecar prestart lifecycle tasks.
Cancel the `joincontext` after the prestart call exits to fix the
leak.
2021-12-23 11:50:51 -05:00
..
getter
interfaces
restarts core: implement system batch scheduler 2021-08-03 10:30:47 -04:00
state
template client: never embed alloc_dir in chroot 2021-10-18 09:22:01 -07:00
testdata
artifact_hook.go
artifact_hook_test.go
connect_native_hook.go consul/connect: automatically set consul tls sni name for connect native tasks 2021-06-28 08:36:53 -05:00
connect_native_hook_test.go test: update tests to properly use AllocDir 2021-10-19 10:49:07 -07:00
device_hook.go
device_hook_test.go
dispatch_hook.go
dispatch_hook_test.go test: update tests to properly use AllocDir 2021-10-19 10:49:07 -07:00
driver_handle.go core: propagate remote task handles 2021-04-27 15:07:03 -07:00
envoy_bootstrap_hook.go consul/connect: add missing import statements 2021-07-12 09:28:16 -05:00
envoy_bootstrap_hook_test.go client: never embed alloc_dir in chroot 2021-10-18 09:22:01 -07:00
envoy_version_hook.go
envoy_version_hook_test.go test: update tests to properly use AllocDir 2021-10-19 10:49:07 -07:00
errors.go
errors_test.go
lazy_handle.go
lifecycle.go drivers: Capture exit code when task is killed (#10494) 2021-05-04 10:54:00 -04:00
logmon_hook.go
logmon_hook_test.go
logmon_hook_unix_test.go gofmt all the files 2021-10-01 10:14:28 -04:00
plugin_supervisor_hook.go
remotetask_hook.go core: propagate remote task handles 2021-04-27 15:07:03 -07:00
script_check_hook.go chore: fixup inconsistent method receiver names. (#11704) 2021-12-20 11:44:21 +01:00
script_check_hook_test.go
service_hook.go consul: avoid triggering unnecessary sync when removing workload 2021-07-06 14:08:42 -05:00
service_hook_test.go consul: avoid triggering unnecessary sync when removing workload 2021-07-06 14:08:42 -05:00
sids_hook.go
sids_hook_test.go gofmt all the files 2021-10-01 10:14:28 -04:00
stats_hook.go
stats_hook_test.go
task_dir_hook.go
task_runner.go provide -no-shutdown-delay flag for job/alloc stop (#11596) 2021-12-13 14:54:53 -05:00
task_runner_getters.go
task_runner_hooks.go task runner: fix goroutine leak in prestart hook (#11741) 2021-12-23 11:50:51 -05:00
task_runner_test.go provide -no-shutdown-delay flag for job/alloc stop (#11596) 2021-12-13 14:54:53 -05:00
tasklet.go
tasklet_test.go
template_hook.go
validate_hook.go
validate_hook_test.go
vault_hook.go
vault_hook_test.go
volume_hook.go
volume_hook_test.go