Don't attempt to restore tasks that never sync'd

This commit is contained in:
Michael Schurter 2017-07-24 15:58:46 -07:00
parent 24e5e2faa0
commit b01dd31f26
1 changed files with 6 additions and 0 deletions

View File

@ -289,6 +289,12 @@ func (r *AllocRunner) RestoreState() error {
name := task.Name
state := r.taskStates[name]
// Nomad exited before task could start, nothing to restore.
// AllocRunner.Run will start a new TaskRunner for this task
if state == nil {
continue
}
// Mark the task as restored.
r.restored[name] = struct{}{}