Revert "A nil context isn't an error"

This reverts commit fe9fe4c26259c1ad3bd7e94bd711418aaf819b20.
This commit is contained in:
Michael Schurter 2016-09-12 12:56:12 -07:00
parent 8a57913a44
commit cd8606b9e3

View file

@ -51,14 +51,13 @@ type AllocRunner struct {
dirtyCh chan struct{}
ctx *driver.ExecContext
ctxLock sync.Mutex
ctx *driver.ExecContext
ctxLock sync.Mutex
tasks map[string]*TaskRunner
taskStates map[string]*structs.TaskState
restored map[string]struct{}
taskLock sync.RWMutex
tasks map[string]*TaskRunner
restored map[string]struct{}
taskLock sync.RWMutex
taskStates map[string]*structs.TaskState
taskStatusLock sync.RWMutex
updateCh chan *structs.Allocation
@ -127,6 +126,9 @@ func (r *AllocRunner) RestoreState() error {
if r.alloc == nil {
snapshotErrors.Errors = append(snapshotErrors.Errors, fmt.Errorf("alloc_runner snapshot includes a nil allocation"))
}
if r.ctx == nil {
snapshotErrors.Errors = append(snapshotErrors.Errors, fmt.Errorf("alloc_runner snapshot includes a nil context"))
}
if e := snapshotErrors.ErrorOrNil(); e != nil {
return e
}