flyte icon indicating copy to clipboard operation
flyte copied to clipboard

[BUG] [V2] Executor loses the SystemFailures counter on status conflict, so a failing task retries forever and its TaskAction outgrows etcd

Open earlybard opened this issue 3 weeks ago • 1 comments

Describe the bug recordSystemError increments Status.SystemFailures but saves it with a single Status().Update and only logs a failure. When that update conflicts, the increment is lost, so maxSystemFailures is never reached and the task is resubmitted indefinitely.

In our case a0 of a run hit [InformerWatchFailure] … dns error and then cycled Queued → Executing every ~4s for days. Every cycle logged:

ERROR system error from plugin {"plugin": "pod", "error": "[InformerWatchFailure] …"}
ERROR failed to persist SystemFailures counter {"error": "Operation cannot be fulfilled on taskactions.flyte.org \"…-a0\": the object has been modified; …"}

Meanwhile status.phaseHistory kept growing (16,758 entries, 1.56 MB). Once the CR hit etcd's size limit, every write was rejected with etcdserver: request is too large, including the executor's own status updates and kubectl delete. The pod (with karpenter.sh/do-not-disrupt) was recreated for weeks and pinned its node. Clearing phaseHistory through the status subresource was the only way to delete it.

Expected behavior The task fails permanently with MaxSystemFailuresExceeded after maxSystemFailures system errors.

Versions flyte-binary-v2 v2.0.52. The same code is on main (executor/pkg/controller/taskaction_controller.go, recordSystemError).

Additional context Other status writes in the reconciler use persistStatusWithRetry; this one doesn't. The conflict happened on every cycle, most likely because the failure reconcile read the TaskAction from the informer cache before the preceding Queued/Executing write had landed in it. appendPhaseHistory only dedups against the last entry, which is why the loop grew the CR without bound. Possibly related: #7926.

earlybard avatar Nov 06 '26 00:11 earlybard

The reported failure mode is consistent with the current code: recordSystemError increments SystemFailures, then makes a single status update and only logs if it fails; the counter may therefore not persist. Other status writes use persistStatusWithRetry, which retries conflicts. A conflict-safe persistence path is needed for this counter so repeated system failures can reach the configured limit and become MaxSystemFailuresExceeded (controller code). The provided sources do not establish the reported phaseHistory growth or etcd-size behavior.

Would you like more detail on a possible fix?

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @herald to ask follow-up questions. See runllm.com for more!

runllm avatar Nov 06 '26 00:11 runllm