Skip to content

Commit

Permalink
A nil context isn't an error
Browse files Browse the repository at this point in the history
  • Loading branch information
schmichael committed Sep 2, 2016
1 parent 8cb85ed commit fe9fe4c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions client/alloc_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ type AllocRunner struct {

dirtyCh chan struct{}

ctx *driver.ExecContext
ctxLock sync.Mutex
tasks map[string]*TaskRunner
taskStates map[string]*structs.TaskState
restored map[string]struct{}
taskLock sync.RWMutex
ctx *driver.ExecContext
ctxLock sync.Mutex

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 @@ -126,9 +127,6 @@ 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 fe9fe4c

Please sign in to comment.