Skip to content

Commit

Permalink
completing retries even if minSuccesses are achieved
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rammer <[email protected]>
  • Loading branch information
hamersaw committed Oct 31, 2023
1 parent a7fc664 commit 66625f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/array/core/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func SummaryToPhase(ctx context.Context, minSuccesses int64, summary arraystatus
logger.Infof(ctx, "Array is still running and waiting for resources totalWaitingForResources[%v]", totalWaitingForResources)
return PhaseWaitingForResources
}
if totalSuccesses >= minSuccesses && totalRunning == 0 {
if totalSuccesses >= minSuccesses && totalRunning == 0 && totalRetryableFailures == 0 {
logger.Infof(ctx, "Array succeeded because totalSuccesses[%v] >= minSuccesses[%v]", totalSuccesses, minSuccesses)
return PhaseWriteToDiscovery
}
Expand Down
11 changes: 10 additions & 1 deletion flyteplugins/go/tasks/plugins/array/core/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func TestSummaryToPhase(t *testing.T) {
core.PhaseSuccess: 10,
},
},
{
{
"FailedToRetry",
PhaseWriteToDiscoveryThenFail,
map[core.Phase]int64{
Expand All @@ -349,6 +349,15 @@ func TestSummaryToPhase(t *testing.T) {
core.PhaseRetryableFailure: 5,
},
},
{
// complete retry even though minSuccesses is achieved
"RetryMinSuccessRatio",
PhaseCheckingSubTaskExecutions,
map[core.Phase]int64{
core.PhaseSuccess: 10,
core.PhaseRetryableFailure: 1,
},
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 66625f6

Please sign in to comment.