Skip to content

Commit

Permalink
Revert "A nil context isn't an error"
Browse files Browse the repository at this point in the history
This reverts commit fe9fe4c.
  • Loading branch information
schmichael committed Sep 12, 2016
1 parent fe9fe4c commit 78a4bef
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions client/alloc_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 78a4bef

Please sign in to comment.