Skip to content

server: store a task only once its actor exists - #761

Merged
yongruilin merged 1 commit into
google:mainfrom
yongruilin:ax-clear-task-creation
Nov 25, 2026
Merged

yongruilin merged 1 commit into
google:mainfrom
yongruilin:ax-clear-task-creation

Conversation

@yongruilin

@yongruilin yongruilin commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

CreateTask now provisions the actor first and stores the task only once the actor exists. A failed create returns the error and stores nothing. Fixes #698.

  • When provisioning or the store write fails, CreateTask deletes the actor. An actor left by a failed delete or a crash is adopted by the next create of that name.
  • A task that already exists is always rejected: the retry of a stored QUEUED task is gone, and QUEUED is no longer stored for a create.
  • metadata.uid, createTime and the default sessionId are assigned when the task is stored.
  • ax apply gives CreateTask five minutes, as it does CreateWorkspace, because ax resume can no longer finish a failed create.

Follow-up (#695): ResumeTask still stores QUEUED after a transient Substrate error. The next PR removes that and the QUEUED state with it, so a failed resume only returns its error.

A failed create returns the error, deletes the actor and stores nothing.
`ax apply` gives a Task five minutes, as it does a Workspace. Fixes google#698.
@yongruilin
yongruilin merged commit da04c0d into google:main Nov 25, 2026
13 checks passed
yongruilin added a commit that referenced this pull request Nov 25, 2026
The task manager and workspace prepare no longer set a
`SubstrateUnavailable` condition when a call fails with a transient
error; they only return the error. Part of #695.

- After a failed resume a task is still `Queued`, now without a `Ready`
condition. A Workspace whose prepare failed stays `Preparing`, now
without conditions.
- `QUEUED` stays, as #695 describes. The follow-up note in #761 said the
next PR would remove it; that is a separate question.
- `TestWorkspacePrewarm_CanceledContextStillPersistsStatus` becomes
`TestWorkspacePrewarm_CanceledContextStaysPreparing`.
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.

CreateTask: do not store a Task until its actor exists

2 participants