[flyteplugins]: require a fresh LastReconcileTime for operator liveness in the kfoperator stale-CR check - #25
Conversation
…ness in the stale-CR check A LastReconcileTime that merely exists proves the operator saw the job once, not that it is still running. The training operator refreshes LastReconcileTime on every reconcile while it withholds pods for a PodGroup awaiting admission, so treat it as liveness only while it is newer than kf-operator.timeout. A job the operator touched once and then abandoned is failed after the timeout instead of sitting Queued forever. Assisted-by: Devin:claude-opus-4.6
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Heron review (relayed)Heron reviewed head Review decision: Request changesInline —
|
|
Closing per @pfernandes21: Heron's blocking finding above holds — v1.8.0 does not keep refreshing |
Tracking issue
Stacked on #24 (targets its branch). Addresses the review finding that a one-time
lastReconcileTimebecomes permanent liveness.Why are the changes needed?
#24 makes
OperatorNeverReconciledreturn false wheneverstatus.lastReconcileTime != nil. That only proves the operator saw the job once. If the operator writeslastReconcileTimeand then dies or wedges, the stale-CR check never fires again for that job, so a queued gang job sits inQueuedindefinitely instead of failing afterkf-operator.timeout.The training operator (v1.8.0,
pkg/controller.v1/common/job.go) setslastReconcileTimeonly in the gang-wait branch (DelayPodCreationDueToPodGroup), and the status write re-enqueues the job, so a live operator keeps refreshing it every reconcile while the PodGroup waits. Freshness is therefore a valid liveness signal: recent timestamp = operator alive, frozen timestamp = operator gone.What changes were proposed in this pull request?
Semantics: with no
StartTime, the job is stale when neither creation nor the latest reconcile happened withintimeout. AlastReconcileTimeolder than creation (clock skew) never shortens the grace period. Behaviour forStartTime != nil, suspended jobs, and never-reconciled jobs is unchanged from #24.How was this patch tested?
TestOperatorStalecovers: never reconciled (inside/outside timeout),StartTimeset, freshlastReconcileTimepast creation timeout (Queued),lastReconcileTimeexactly inside the window, stalelastReconcileTime(fails), skewedlastReconcileTimeolder than creation.TestGetTaskPhasein mpi/pytorch/tensorflow: existing gang-wait case now uses a fresh (-1s) timestamp, plus a new "operator reconciled once, then went away" case asserting thekubeflow operator hasn't updatederror.go test ./go/tasks/plugins/k8s/kfoperators/...passes;gofmt -lclean.Labels
fixed
Check all the applicable boxes
Related PRs
#24
Link to Devin session: https://app.devin.ai/sessions/72abcac0dc9d453ea9989e647eebfa32
Open in Devin Desktop: https://app.devin.ai/desktop/session/72abcac0dc9d453ea9989e647eebfa32?variant=devin
Requested by: @pfernandes21