Skip to content

ateapi: release a suspend's replaced snapshot after committing SUSPENDED - #2006

Merged
Luiz Oliveira (laoj2) merged 1 commit into
agent-substrate:mainfrom
haiyanmeng:actor-stuck-in-pending
Sep 30, 2026
Merged

Luiz Oliveira (laoj2) merged 1 commit into
agent-substrate:mainfrom
haiyanmeng:actor-stuck-in-pending

Conversation

@haiyanmeng

Copy link
Copy Markdown
Collaborator

FinalizeSuspended deleted the external snapshot a suspend replaced before committing SUSPENDED. By then the new checkpoint is uploaded and the worker's assignment row is released, so a transient object-store error (429/503) on that delete aborted the workflow with the actor stuck in SUSPENDING: ResumeActor rejects that state with FailedPrecondition, and a retried suspend re-sends Checkpoint to the already-released worker, which most likely crashes the actor despite a good snapshot in storage.

Commit SUSPENDED first, then release the replaced snapshot best-effort, logging a failure instead of returning it. A failed release now leaves the old snapshot's objects in storage until the actor is deleted, which removes its whole prefix, rather than stranding the actor. A commit lost to a concurrent update releases nothing, since the record still names the old snapshot.

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

FinalizeSuspended deleted the external snapshot a suspend replaced before
committing SUSPENDED. By then the new checkpoint is uploaded and the
worker's assignment row is released, so a transient object-store error
(429/503) on that delete aborted the workflow with the actor stuck in
SUSPENDING: ResumeActor rejects that state with FailedPrecondition, and a
retried suspend re-sends Checkpoint to the already-released worker, which
most likely crashes the actor despite a good snapshot in storage.

Commit SUSPENDED first, then release the replaced snapshot best-effort,
logging a failure instead of returning it. A failed release now leaves
the old snapshot's objects in storage until the actor is deleted, which
removes its whole prefix, rather than stranding the actor. A commit lost
to a concurrent update releases nothing, since the record still names
the old snapshot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants