From b01dd31f2697c83421d81dd81a90af7b1a0df40c Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Mon, 24 Jul 2017 15:58:46 -0700 Subject: [PATCH] Don't attempt to restore tasks that never sync'd --- client/alloc_runner.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/alloc_runner.go b/client/alloc_runner.go index 3ab9a5d07..66af29b56 100644 --- a/client/alloc_runner.go +++ b/client/alloc_runner.go @@ -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{}{}