Skip to content

controller: replace Reconcile with explicit Suspend and Resume - #536

Merged
yongruilin merged 2 commits into
google:mainfrom
yongruilin:ax-explicit-suspend-resume
Oct 30, 2026
Merged

yongruilin merged 2 commits into
google:mainfrom
yongruilin:ax-explicit-suspend-resume

Conversation

@yongruilin

Copy link
Copy Markdown
Collaborator

Fixes #534.

Handlers no longer set task.Status.Phase to tell the reconciler what to do (#515). TaskReconciler.Reconcile is replaced by explicit Suspend and Resume, which share ensureSubstrateResources (atespace, template, actor). ReconcileDelete is renamed Delete.

  • CreateTask calls Suspend, so starting suspended is an explicit step.
  • The reconciler no longer writes the phase, actor name or worker IP. On failure it records only the Ready reason. When create or resume fails, the server's recordFailure stores Pending for a transient error and Failed otherwise. The issue left Pending/Failed to the reconciler; here only the server sets the phase.
  • A successful call clears the stored phase, so reads take it from the actor (new test: TestServer_SuccessClearsStoredFailure).
  • No behavior change: a before/after trace against main showed the same Substrate calls, gRPC codes, responses and stored status.
  • AGENTS.md and the substrate skill describe the new flow. They also fix text left stale by server: remove the Reconciler interface #532: the server and CLI tests use substratetest.

The server calls Suspend or Resume instead of setting the task's phase
for Reconcile to read. The reconciler no longer writes the phase; the
server decides it. ReconcileDelete becomes Delete.

Fixes google#534.
Describe the explicit Suspend/Resume/Delete flow, and list substratetest,
which the server and CLI tests have used since google#532.
@yongruilin

Copy link
Copy Markdown
Collaborator Author

@janetkuo @rakyll @mayawang PTAL.
(I'm bad at naming, welcome any suggestion on the function's name)

@janetkuo janetkuo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. SuspendTask stores nothing on failure so a stored Pending/Failed doesn't hide the actor's live state, but a failed resume of an existing actor stores Pending/Failed and hides its Suspended state until the next successful call. This can be addressed in a follow up if needed.

@janetkuo

Copy link
Copy Markdown
Member

The function naming is good too

@yongruilin
yongruilin merged commit f0228f1 into google:main Oct 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

controller: replace Reconcile with explicit Suspend and Resume

2 participants