Skip to content

Commit

Permalink
return if available parallelism is 0
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Dittamo <[email protected]>
  • Loading branch information
pvditt committed Apr 3, 2024
1 parent 97c7c32 commit 65ab929
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flytepropeller/pkg/controller/nodes/array/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ func (a *arrayNodeHandler) Handle(ctx context.Context, nCtx interfaces.NodeExecu

nodeExecutionRequests := make([]*nodeExecutionRequest, 0, availableParallelism)
for i, nodePhaseUint64 := range arrayNodeState.SubNodePhases.GetItems() {
if availableParallelism == 0 {
break
}

nodePhase := v1alpha1.NodePhase(nodePhaseUint64)
taskPhase := int(arrayNodeState.SubNodeTaskPhases.GetItem(i))

Expand Down Expand Up @@ -315,9 +319,6 @@ func (a *arrayNodeHandler) Handle(ctx context.Context, nCtx interfaces.NodeExecu
nCtx.ExecutionContext().IncrementParallelism()

Check warning on line 319 in flytepropeller/pkg/controller/nodes/array/handler.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/handler.go#L319

Added line #L319 was not covered by tests
}
availableParallelism--
if availableParallelism == 0 {
break
}
}

workerErrorCollector := errorcollector.NewErrorMessageCollector()
Expand Down

0 comments on commit 65ab929

Please sign in to comment.