feat(controller): reconcile dependents when their cluster becomes ready#138
Open
bmorton wants to merge 9 commits into
Open
feat(controller): reconcile dependents when their cluster becomes ready#138bmorton wants to merge 9 commits into
bmorton wants to merge 9 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 136e3309-64e9-4f7a-8a1d-4bab174e96e1 Signed-off-by: Brian Morton <brian@mmmhm.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 136e3309-64e9-4f7a-8a1d-4bab174e96e1 Signed-off-by: Brian Morton <brian@mmmhm.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 136e3309-64e9-4f7a-8a1d-4bab174e96e1 Signed-off-by: Brian Morton <brian@mmmhm.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 136e3309-64e9-4f7a-8a1d-4bab174e96e1 Signed-off-by: Brian Morton <brian@mmmhm.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Brian Morton <brian@mmmhm.com> Copilot-Session: 136e3309-64e9-4f7a-8a1d-4bab174e96e1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 136e3309-64e9-4f7a-8a1d-4bab174e96e1 Signed-off-by: Brian Morton <brian@mmmhm.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 136e3309-64e9-4f7a-8a1d-4bab174e96e1 Signed-off-by: Brian Morton <brian@mmmhm.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 136e3309-64e9-4f7a-8a1d-4bab174e96e1 Signed-off-by: Brian Morton <brian@mmmhm.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 136e3309-64e9-4f7a-8a1d-4bab174e96e1 Signed-off-by: Brian Morton <brian@mmmhm.com>
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.
Problem
When a
TemporalClusterand a dependent object (e.g.TemporalNamespace) are created at the same time, the dependent registers much later than the cluster becomes ready. Two mechanics cause this:TemporalNamespace,TemporalSchedule,TemporalSearchAttribute,TemporalWorkflowRun,TemporalClusterConnection) resolve their target viaresolveTargetand, when the cluster isn'tReady, just requeue on a timer. None of them watch theTemporalCluster/TemporalDevServer, so nothing re-triggers a reconcile the moment the cluster flips toReady.Ready, the controllers immediately call the frontend. If it's up but not yet serving RPCs, the call returns a raw error and the controllersreturn ctrl.Result{}, err— so controller-runtime applies exponential backoff (default max ~16.7 min). The object is "caught in a backoff" and registers long after the cluster is usable.This also slowed the e2e suites, which sequenced cluster-first-then-dependent to sidestep the delay.
Changes
internal/controller/cluster_watch.go): aclusterReadinessChangedpredicate (fires on create, generation change, or aReady-condition transition — ignores routine status writes), arefTargetsmatcher (same-namespace, emptyKinddefaults toTemporalCluster), anisTransientClusterErrclassifier (gRPCUnavailable/DeadlineExceeded/Canceled), andclusterUnavailableRequeue = 5s. New reason constReasonFrontendUnavailable..WatchesTemporalClusterandTemporalDevServer, mapping a changed target to same-namespace CRs referencing it. Dependents reconcile the instant their cluster becomesReady.Ready=False/FrontendUnavailable) instead of erroring. Terminal errors still surface.TemporalClusterConnectionalready swallowed transient per-peer errors, so it gets the watch only.test/e2e/namespacenow applies the cluster and namespace concurrently, proving the fix and trimming wall-clock time.Testing
make lint— 0 issuesmake test(unit + envtest) — all pass, no generated driftNo API/CRD schema changes.
Design & plan:
docs/superpowers/specs/2026-07-24-cluster-readiness-watch-design.md,docs/superpowers/plans/2026-07-24-cluster-readiness-watch.md.