fix: prevent stale ready status after stack update#3610
Conversation
Greptile SummaryAddresses a race condition where the controller would read a stale
Confidence Score: 4/5The core logic is safe to merge; the race-condition fix is correct and well-scoped. The go/controller/internal/controller/infrastructurestack_controller.go — specifically the requeue interval change in
|
| Filename | Overview |
|---|---|
| go/controller/internal/controller/infrastructurestack_controller.go | Adds a changed flag so the controller waits ~5 s after a stack update before calling GetStackStatus, preventing stale "Successful" reads. Also changes handleExistingResource to always requeue every 2 min instead of respecting Reconciliation.Requeue(), which silently alters behavior for drift-detection-disabled stacks. |
Reviews (1): Last reviewed commit: "format" | Re-trigger Greptile
When a stack was updated, the controller immediately queried the Console API for the status. This could incorrectly return Successful from the previous run.
This PR reduces the requeue interval to provide more responsive status updates.
It also fixes requeue behavior in read-only mode to ensure the actual status is retrieved.
The
stack.Spec.Reconciliation.Requeue()replaced withctrl.Result{RequeueAfter: requeueAfterInfrastructureStack}Test Plan
Test environment: https://console.your-env.onplural.sh/
Checklist
Plural Flow: console