Conversation
A WorkloadRun can observe workflowRef before its Workflow reaches the manager cache. Confirm a cache miss through the uncached API reader; wait while the Workflow exists, fail only on confirmed absence, and retry other read errors. Default the API reader in manager setup, restore full lifecycle Event fixtures, and cover cache lag, confirmed deletion, and live-read failure. Closes NVIDIA#352 Signed-off-by: Kayne Tu <kaynet@nvidia.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA/cluster-readiness-engine/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (16)
📒 Files selected for processing (5)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe WorkloadRun reconciler now uses an uncached API reader to verify a Workflow after a cached lookup returns NotFound. It requeues when the live read finds the Workflow, returns other live-read errors, and marks the WorkloadRun failed when the live read confirms deletion. Manager and integration test setup pass the API reader. Integration tests no longer directly reconcile WorkloadRuns before manager startup. Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change avoids false deletion failures during cache lag while preserving confirmed-deletion handling and lifecycle assertions. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
asivanadi0
left a comment
There was a problem hiding this comment.
Tip review 52a1aab (closes #352)
Checked against #352 acceptance criteria and the follow-up comment on restoring Normal / WorkflowCreated:
- Cache lag vs confirmed absence:
mirrorWorkflowStatusonly fails closed after an uncachedAPIReaderNotFound; a live hit requeues without status/Event writes; other live-read errors return for retry with no terminal write. Matches the issue. - Wiring:
SetupWithManagerdefaultsAPIReader(covered byTestWorkloadRunSetupDefaultsAPIReader);main.goand the integration manager also passmgr.GetAPIReader(), so a manager-backed reconciler cannot confirm against the same cache. - Tests:
workloadrun-workflow-lookupgoldens cover cache-hit (0 API reads), cache-lag (requeue, no Event), confirmed deletion (Failed/WorkflowDeleted+ Warning), and live-read error (error returned, status unchanged). Integration restores full create→success / MPI lifecycle withWorkflowCreated, and addsworkloadrun-workflow-deletedfor confirmed absence. - Docs: ADR-080 marks #352 resolved and documents the restored fixtures consistently.
- CI on this tip: Lint/Test/Build/UAT/DCO and related checks are green (not thin / not awaiting
/ok).
Non-blocking nit: on the cache-lag path the live Get already populated workflow, but the reconciler requeues instead of mirroring from that object. Fine given the Owns-watch safety net and the rare race window; optional follow-up if you want to shave the worst-case 15s wait.
Approve.
Summary
A WorkloadRun can observe its persisted
workflowRefbefore the new Workflow reaches the manager cache. A cachedNotFoundpreviously persisted terminalFailed / WorkflowDeletedand produced a misleading Warning Event.SetupWithManagerso a manager-backed reconciler cannot silently recheck the same stale cache.Normal / WorkflowCreated, and add deterministic cache-lag, confirmed-deletion, and live-read-error coverage.Related Issue
Closes #352. Follow-up to #349.
Type of Change
Component(s) Affected
Testing
make lint,make build, and the fullmake testsuite passed before the final rebase onto currentmain. After that rebase,go test ./pkg/controller -count=1, the three affected WorkloadRun integration fixtures with-race, andgit diff --checkpassed. The affected fixtures also passed three fresh-process race runs before the rebase. The final branch is one signed, DCO-signed commit ahead ofmain; no live-cluster UAT was run.Risk Assessment
The extra API read occurs only after a cached Workflow miss. A live-read error returns for retry without changing WorkloadRun status; a confirmed API
NotFoundretains the existingWorkflowDeletedfailure and Warning. No CRD schema, RBAC, chart, or dependency changes.Checklist
git commit -s)make manifests generaterun as part ofmake build; no*_types.gochanged