Merge pull request #411 from hashicorp/b-save-tr-state
Saving state of the Task Runner while it's trying to update it
This commit is contained in:
commit
88d64f5d9b
|
@ -279,9 +279,6 @@ func (r *AllocRunner) setTaskStatus(taskName, status, desc string) {
|
|||
Description: desc,
|
||||
}
|
||||
r.taskStatusLock.Unlock()
|
||||
if tr, ok := r.tasks[taskName]; ok {
|
||||
r.saveTaskRunnerState(tr)
|
||||
}
|
||||
select {
|
||||
case r.dirtyCh <- struct{}{}:
|
||||
default:
|
||||
|
|
|
@ -134,6 +134,9 @@ func (r *TaskRunner) DestroyState() error {
|
|||
|
||||
// setStatus is used to update the status of the task runner
|
||||
func (r *TaskRunner) setStatus(status, desc string) {
|
||||
if err := r.SaveState(); err != nil {
|
||||
r.logger.Printf("[ERR] client: failed to save state of Task Runner: %v", r.task.Name)
|
||||
}
|
||||
r.updater(r.task.Name, status, desc)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue