Skip to content

Commit 43cb270

Browse files
committed
boundary issue
Signed-off-by: yuteng <a08h0283@gmail.com>
1 parent 144cb78 commit 43cb270

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

flytepropeller/pkg/controller/nodes/dynamic/handler.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ func (d dynamicNodeTaskNodeHandler) produceDynamicWorkflow(ctx context.Context,
9696
dCtx, err := d.buildContextualDynamicWorkflow(ctx, nCtx)
9797
if err != nil {
9898
if stdErrors.IsCausedBy(err, utils.ErrorCodeUser) {
99+
isPermanent := !stdErrors.IsCausedBy(err, utils.ErrorCodeSystem)
99100
return handler.DoTransition(handler.TransitionTypeEphemeral,
100101
handler.PhaseInfoFailure(core.ExecutionError_USER, "DynamicWorkflowBuildFailed", err.Error(), nil),
101-
), handler.DynamicNodeState{Phase: v1alpha1.DynamicNodePhaseFailing, Reason: err.Error(), IsFailurePermanent: true}, nil
102+
), handler.DynamicNodeState{Phase: v1alpha1.DynamicNodePhaseFailing, Reason: err.Error(), IsFailurePermanent: isPermanent}, nil
102103
}
103104
return handler.Transition{}, handler.DynamicNodeState{}, err
104105
}
@@ -123,9 +124,10 @@ func (d dynamicNodeTaskNodeHandler) handleDynamicSubNodes(ctx context.Context, n
123124
dCtx, err := d.buildContextualDynamicWorkflow(ctx, nCtx)
124125
if err != nil {
125126
if stdErrors.IsCausedBy(err, utils.ErrorCodeUser) {
127+
isPermanent := !stdErrors.IsCausedBy(err, utils.ErrorCodeSystem)
126128
return handler.DoTransition(handler.TransitionTypeEphemeral,
127129
handler.PhaseInfoFailure(core.ExecutionError_USER, "DynamicWorkflowBuildFailed", err.Error(), nil),
128-
), handler.DynamicNodeState{Phase: v1alpha1.DynamicNodePhaseFailing, Reason: err.Error(), IsFailurePermanent: true}, nil
130+
), handler.DynamicNodeState{Phase: v1alpha1.DynamicNodePhaseFailing, Reason: err.Error(), IsFailurePermanent: isPermanent}, nil
129131
}
130132
// Mostly a system error or unknown
131133
return handler.Transition{}, handler.DynamicNodeState{}, err

flytepropeller/pkg/controller/workflow/executor.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,10 @@ func (c *workflowExecutor) HandleAbortedWorkflow(ctx context.Context, w *v1alpha
494494
return err
495495
}
496496

497-
if w.Status.FailedAttempts > maxRetries {
497+
if w.Status.FailedAttempts >= maxRetries {
498+
if err != nil {
499+
logger.Warningf(ctx, "Discarding cleanup error because system retries are exhausted: %v", err)
500+
}
498501
err = errors.Errorf(errors.RuntimeExecutionError, w.GetID(), "max number of system retry attempts [%d/%d] exhausted. Last known status message: %v", w.Status.FailedAttempts, maxRetries, w.Status.Message)
499502
}
500503

0 commit comments

Comments
 (0)