From ad4ce209a87ad56c6a20d660531561b0d68b530d Mon Sep 17 00:00:00 2001 From: Miguel Toledo Date: Fri, 24 Apr 2020 12:54:15 -0700 Subject: [PATCH] abort then finalize --- go/tasks/plugins/array/k8s/launcher.go | 5 +++-- go/tasks/plugins/array/k8s/task.go | 7 ------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/go/tasks/plugins/array/k8s/launcher.go b/go/tasks/plugins/array/k8s/launcher.go index 5af0a6965..25dd53f3a 100644 --- a/go/tasks/plugins/array/k8s/launcher.go +++ b/go/tasks/plugins/array/k8s/launcher.go @@ -70,11 +70,12 @@ func TerminateSubTasks(ctx context.Context, tCtx core.TaskExecutionContext, kube Config: config, State: currentState, } - err := task.Finalize(ctx, tCtx, kubeClient) + + err := task.Abort(ctx, tCtx, kubeClient) if err != nil { errs.Collect(childIdx, err.Error()) } - err = task.Abort(ctx, tCtx, kubeClient) + err = task.Finalize(ctx, tCtx, kubeClient) if err != nil { errs.Collect(childIdx, err.Error()) } diff --git a/go/tasks/plugins/array/k8s/task.go b/go/tasks/plugins/array/k8s/task.go index c52610869..6af9c0aea 100644 --- a/go/tasks/plugins/array/k8s/task.go +++ b/go/tasks/plugins/array/k8s/task.go @@ -175,13 +175,6 @@ func (t Task) Abort(ctx context.Context, tCtx core.TaskExecutionContext, kubeCli return err } - // Deallocate Resource - err = deallocateResource(ctx, tCtx, t.Config, t.ChildIdx) - if err != nil { - logger.Errorf(ctx, "Error releasing allocation token [%s] in Finalize [%s]", podName, err) - return err - } - return nil }