account for client restarts in task lifecycle hooks
This commit is contained in:
parent
81d051d7e8
commit
0c44d0017d
|
@ -362,13 +362,18 @@ func (ar *allocRunner) Restore() error {
|
|||
ar.state.DeploymentStatus = ds
|
||||
ar.stateLock.Unlock()
|
||||
|
||||
states := make(map[string]*structs.TaskState)
|
||||
|
||||
// Restore task runners
|
||||
for _, tr := range ar.tasks {
|
||||
if err := tr.Restore(); err != nil {
|
||||
return err
|
||||
}
|
||||
states[tr.Task().Name] = tr.TaskState()
|
||||
}
|
||||
|
||||
ar.taskHookCoordinator.taskStateUpdated(states)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue