From f616f34b96c765d8ac936df81306ece676181b82 Mon Sep 17 00:00:00 2001 From: Anand Swaminathan Date: Tue, 29 Sep 2020 15:19:39 -0700 Subject: [PATCH] Add debug --- go/tasks/plugins/array/k8s/executor.go | 6 ++++++ go/tasks/plugins/array/k8s/monitor.go | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/go/tasks/plugins/array/k8s/executor.go b/go/tasks/plugins/array/k8s/executor.go index eea808221..9a8aaa695 100644 --- a/go/tasks/plugins/array/k8s/executor.go +++ b/go/tasks/plugins/array/k8s/executor.go @@ -106,19 +106,24 @@ func (e Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (c err = nil case arrayCore.PhaseCheckingSubTaskExecutions: + logger.Debugf(ctx, "In PhaseCheckingSubTaskExecutions [%v] - [%v]", tCtx, pluginState) nextState, logLinks, err = LaunchAndCheckSubTasksState(ctx, tCtx, e.kubeClient, pluginConfig, tCtx.DataStore(), tCtx.OutputWriter().GetOutputPrefixPath(), tCtx.OutputWriter().GetRawOutputPrefix(), pluginState) case arrayCore.PhaseAssembleFinalOutput: + logger.Debugf(ctx, "In PhaseAssembleFinalOutput [%v] - [%v]", tCtx, pluginState) nextState, err = array.AssembleFinalOutputs(ctx, e.outputsAssembler, tCtx, arrayCore.PhaseSuccess, pluginState) case arrayCore.PhaseWriteToDiscoveryThenFail: + logger.Debugf(ctx, "In PhaseWriteToDiscoveryThenFail [%v] - [%v]", tCtx, pluginState) nextState, err = array.WriteToDiscovery(ctx, tCtx, pluginState, arrayCore.PhaseAssembleFinalError) case arrayCore.PhaseWriteToDiscovery: + logger.Debugf(ctx, "In PhaseWriteToDiscovery [%v] - [%v]", tCtx, pluginState) nextState, err = array.WriteToDiscovery(ctx, tCtx, pluginState, arrayCore.PhaseAssembleFinalOutput) case arrayCore.PhaseAssembleFinalError: + logger.Debugf(ctx, "In PhaseAssembleFinalError [%v] - [%v]", tCtx, pluginState) nextState, err = array.AssembleFinalOutputs(ctx, e.errorAssembler, tCtx, arrayCore.PhaseRetryableFailure, pluginState) default: @@ -126,6 +131,7 @@ func (e Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (c err = nil } if err != nil { + logger.Errorf(ctx, "K8s array transition failed %v", err) return core.UnknownTransition, err } diff --git a/go/tasks/plugins/array/k8s/monitor.go b/go/tasks/plugins/array/k8s/monitor.go index 66e4dd0f3..4c34ffcab 100644 --- a/go/tasks/plugins/array/k8s/monitor.go +++ b/go/tasks/plugins/array/k8s/monitor.go @@ -111,7 +111,8 @@ func LaunchAndCheckSubTasksState(ctx context.Context, tCtx core.TaskExecutionCon var monitorResult MonitorResult monitorResult, err = task.Monitor(ctx, tCtx, kubeClient, dataStore, outputPrefix, baseOutputDataSandbox) - if monitorResult != MonitorSuccess { + logger.Debugf(ctx, "K8s array task monitor %v - %v - %v", task, monitorResult, err) + if err != nil || monitorResult != MonitorSuccess { return currentState, logLinks, err } }