diff --git a/client/allocrunner/alloc_runner_hooks.go b/client/allocrunner/alloc_runner_hooks.go index a5fcac0fdf5e..8b79da4d5cf4 100644 --- a/client/allocrunner/alloc_runner_hooks.go +++ b/client/allocrunner/alloc_runner_hooks.go @@ -339,7 +339,7 @@ func (ar *allocRunner) preKillHooks() { ar.logger.Trace("running alloc pre shutdown hook", "name", name, "start", start) } - pre.PreKill(ar.alloc) + pre.PreKill() if ar.logger.IsTrace() { end := time.Now() diff --git a/client/allocrunner/groupservice_hook.go b/client/allocrunner/groupservice_hook.go index 0ad063d911cd..69eae41e8bf7 100644 --- a/client/allocrunner/groupservice_hook.go +++ b/client/allocrunner/groupservice_hook.go @@ -168,18 +168,18 @@ func (h *groupServiceHook) PreTaskRestart() error { h.mu.Unlock() }() - h.preKillLocked(nil) + h.preKillLocked() return h.prerunLocked() } -func (h *groupServiceHook) PreKill(alloc *structs.Allocation) { +func (h *groupServiceHook) PreKill() { h.mu.Lock() defer h.mu.Unlock() - h.preKillLocked(alloc) + h.preKillLocked() } // implements the PreKill hook but requires the caller hold the lock -func (h *groupServiceHook) preKillLocked(alloc *structs.Allocation) { +func (h *groupServiceHook) preKillLocked() { // If we have a shutdown delay deregister group services and then wait // before continuing to kill tasks. h.deregister() diff --git a/client/allocrunner/interfaces/runner_lifecycle.go b/client/allocrunner/interfaces/runner_lifecycle.go index 92ef52b83002..7855deaa3f4d 100644 --- a/client/allocrunner/interfaces/runner_lifecycle.go +++ b/client/allocrunner/interfaces/runner_lifecycle.go @@ -22,7 +22,7 @@ type RunnerPrerunHook interface { type RunnerPreKillHook interface { RunnerHook - PreKill(*structs.Allocation) + PreKill() } // RunnerPostrunHooks are executed after calling TaskRunner.Run, even for diff --git a/command/alloc_stop.go b/command/alloc_stop.go index 2875f62598e8..3b1d10218ab2 100644 --- a/command/alloc_stop.go +++ b/command/alloc_stop.go @@ -42,9 +42,7 @@ Stop Specific Options: Ignore the the group and task shutdown_delay configuration so there is no delay between service deregistration and task shutdown. Note that using this flag will result in failed network connections to the allocation - being stopped. Also note that an allocation that is already waiting for - the shutdown_delay will not be interrupted by running alloc stop again with - this flag. + being stopped. -verbose Show full information. diff --git a/command/job_stop.go b/command/job_stop.go index e007db7a49c1..f6a51d31d786 100644 --- a/command/job_stop.go +++ b/command/job_stop.go @@ -50,10 +50,8 @@ Stop Options: -no-shutdown-delay Ignore the the group and task shutdown_delay configuration so there is no delay between service deregistration and task shutdown. Note that using - this flag will result in failed network connections to the allocation - being stopped. Also note that an allocation that is already waiting for - the shutdown_delay will not be interrupted by running job stop again with - this flag. + this flag will result in failed network connections to the allocations + being stopped. -purge Purge is used to stop the job and purge it from the system. If not set, the diff --git a/website/content/docs/commands/alloc/stop.mdx b/website/content/docs/commands/alloc/stop.mdx index a92eaf322271..03e78e04d58f 100644 --- a/website/content/docs/commands/alloc/stop.mdx +++ b/website/content/docs/commands/alloc/stop.mdx @@ -46,9 +46,7 @@ allocation's namespace. Ignore the the group and task [`shutdown_delay`] configuration so there is no delay between service deregistration and task shutdown. Note that using this flag will result in failed network - connections to the allocation being stopped. Also note that an - allocation that is already waiting for the `shutdown_delay` will not - be interrupted by running `alloc stop` again with this flag. + connections to the allocation being stopped. ## Examples diff --git a/website/content/docs/commands/job/stop.mdx b/website/content/docs/commands/job/stop.mdx index ee8fdc17ce9a..e231935d03b7 100644 --- a/website/content/docs/commands/job/stop.mdx +++ b/website/content/docs/commands/job/stop.mdx @@ -59,9 +59,7 @@ When ACLs are enabled, this command requires a token with the `submit-job`, Ignore the the group and task [`shutdown_delay`] configuration so there is no delay between service deregistration and task shutdown. Note that using this flag will result in failed network - connections to the allocation being stopped. Also note that an - allocation that is already waiting for the `shutdown_delay` will not - be interrupted by running `job stop` again with this flag. + connections to the allocations being stopped. ## Examples