Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
reverting to parallelism increases only on non-terminal phase updates (
Browse files Browse the repository at this point in the history
…#624)

Signed-off-by: Daniel Rammer <daniel@union.ai>
  • Loading branch information
hamersaw authored Sep 29, 2023
1 parent 40fef66 commit 0fcc1da
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/controller/nodes/task/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 0fcc1da

Please sign in to comment.