mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 18:05:42 +03:00
run post-run/post-stop task runner hooks
Handle when prestart failed while restoring a task, to prevent accidentally leaking consul/logmon processes.
This commit is contained in:
@@ -408,6 +408,11 @@ func (tr *TaskRunner) MarkFailedDead(reason string) {
|
||||
SetDisplayMessage(reason).
|
||||
SetFailsTask()
|
||||
tr.UpdateState(structs.TaskStateDead, event)
|
||||
|
||||
// Run the stop hooks in case task was a restored task that failed prestart
|
||||
if err := tr.stop(); err != nil {
|
||||
tr.logger.Error("stop failed while marking task dead", "error", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Run the TaskRunner. Starts the user's task or reattaches to a restored task.
|
||||
|
||||
Reference in New Issue
Block a user