fix(executor): enforce TaskMetadata.timeout as a per-attempt max runtime - #7910
Open
shaon-chowdhury-euc wants to merge 2 commits into
Open
fix(executor): enforce TaskMetadata.timeout as a per-attempt max runtime#7910shaon-chowdhury-euc wants to merge 2 commits into
shaon-chowdhury-euc wants to merge 2 commits into
Conversation
The SDK already serializes max_runtime onto the TaskAction, but the executor never read it, so hung tasks ran to success. Abort and finalize the plugin at the deadline, emit TIMED_OUT, and retry only within the existing attempt budget. Closes flyteorg#7901 Signed-off-by: shaon-chowdhury-euc <shaon.chowdhury@eucalyptus.vc>
Anchor the attempt clock on the plugin's reported start rather than inferring it from PhaseHistory, ignoring reports that predate the attempt. Collapse three deadline predicates into one, and persist the resume marker before cleanup. Fix DeepEqual on *metav1.Time, and resolve error info and fail rate for TIMED_OUT actions. Signed-off-by: shaon-chowdhury-euc <shaon.chowdhury@eucalyptus.vc>
shaon-chowdhury-euc
force-pushed
the
fix/flyte2-max-runtime-enforcement
branch
from
August 25, 2026 06:37
a13073e to
43a77c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TaskMetadata.timeout(max_runtime) in the TaskAction executor: persistAttemptStartedAt/TimeoutAt, abort and finalize the plugin at the deadline, emitTIMED_OUT, and retry only within the existing attempt budget.v2.0.42ignored it, so a 30s task could run for minutes and finishSUCCEEDED.activeDeadlineSecondsas a substitute — on current builds the kubelet kill leaves the Pod object behind and the executor recreates it without consuming an attempt.The bound is enforced against the controller clock. A terminal transition observed before the deadline wins whatever timestamp it carries; from the deadline onward it wins only if
TaskInfo.OccurredAtproves it finished in time. A terminal report with no usable timestamp is indistinguishable from an overrun, so the bound takes precedence.TIMED_OUTwas already terminal for condition actions but rare in practice. Two places that special-casedACTION_PHASE_FAILEDare updated to keep behaviour consistent now that tasks reach it: action-detail error resolution and task-group fail rate.Test plan
Verified:
go test -raceacross./executor/...,./actions/...,./runs/...InvalidSpec; ordinary failures not misclassified as timeouts; system retries not consuming a user attempt; serialized cache reservations held until terminal.make manifests generateproduces no drift; all four CRD copies carry the new status fields.Not yet verified on a live cluster:
flyte.Timeout(max_runtime=30s)task sleeping 300s, end to end through the SDK.