From 0fcc1da879333af1282ee1142651e191eb1d6bb4 Mon Sep 17 00:00:00 2001 From: Dan Rammer Date: Fri, 29 Sep 2023 16:48:03 -0500 Subject: [PATCH] reverting to parallelism increases only on non-terminal phase updates (#624) Signed-off-by: Daniel Rammer --- pkg/controller/nodes/task/handler.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/controller/nodes/task/handler.go b/pkg/controller/nodes/task/handler.go index 5c48441c0..a641b33bc 100644 --- a/pkg/controller/nodes/task/handler.go +++ b/pkg/controller/nodes/task/handler.go @@ -536,13 +536,6 @@ func (t Handler) Handle(ctx context.Context, nCtx interfaces.NodeExecutionContex ts := nCtx.NodeStateReader().GetTaskNodeState() pluginTrns := &pluginRequestedTransition{} - defer func() { - // increment parallelism if the final pluginTrns is not in a terminal state - if pluginTrns != nil && !pluginTrns.pInfo.Phase().IsTerminal() { - eCtx := nCtx.ExecutionContext() - logger.Infof(ctx, "Parallelism now set to [%d].", eCtx.IncrementParallelism()) - } - }() // We will start with the assumption that catalog is disabled pluginTrns.PopulateCacheInfo(catalog.NewFailedCatalogEntry(catalog.NewStatus(core.CatalogCacheStatus_CACHE_DISABLED, nil))) @@ -667,6 +660,10 @@ func (t Handler) Handle(ctx context.Context, nCtx interfaces.NodeExecutionContex return handler.UnknownTransition, err } + // increment parallelism if the final pluginTrns is not in a terminal state + if pluginTrns != nil && !pluginTrns.pInfo.Phase().IsTerminal() { + logger.Infof(ctx, "Parallelism now set to [%d].", nCtx.ExecutionContext().IncrementParallelism()) + } return pluginTrns.FinalTransition(ctx) }