mirror of
https://github.com/kemko/nomad.git
synced 2026-01-09 03:45:41 +03:00
address review comments
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user