Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmood Ali committed Jul 2, 2019
1 parent f3c944a commit 009f186
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/allocrunner/alloc_runner_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func TestAllocRunner_Restore_RunningTerminal(t *testing.T) {
require.Equal(t, events[3].Type, structs.TaskTerminated)
}

// TestAllocRunner_Restore_Completed asserts that restoring a completed
// TestAllocRunner_Restore_CompletedBatch asserts that restoring a completed
// batch alloc doesn't run it again
func TestAllocRunner_Restore_CompletedBatch(t *testing.T) {
t.Parallel()
Expand Down
6 changes: 4 additions & 2 deletions client/allocrunner/taskrunner/task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,11 @@ func (tr *TaskRunner) Run() {
// if restoring a dead task, ensure that task is cleared and all post hooks
// are called without additional state updates
if dead {
// clear driver handle if it was successfully restored on
// already dead task
// do cleanup functions without emitting any additional events/work
// to handle cases where we restored a dead task where client terminated
// after task finished before completing post-run actions.
tr.clearDriverHandle()
tr.stateUpdater.TaskStateUpdated()
if err := tr.stop(); err != nil {
tr.logger.Error("stop failed on terminal task", "error", err)
}
Expand Down

0 comments on commit 009f186

Please sign in to comment.