Skip to content

atelet, ateworker: finish a checkpoint retry after atelet restarts - #3218

Merged
Dmitry Berkovich (dberkov) merged 2 commits into
agent-substrate:mainfrom
chw120:checkpoint-retry-after-atelet-restart
Oct 27, 2026
Merged

Dmitry Berkovich (dberkov) merged 2 commits into
agent-substrate:mainfrom
chw120:checkpoint-retry-after-atelet-restart

Conversation

@chw120

Copy link
Copy Markdown
Collaborator

Follow-up to #2836.

A Checkpoint retry still failed with runsc checkpoint: exit status 128 when atelet died before the snapshot committed: while staging the local snapshot or after publishing it (both reported by Eren Akbulut (@eren23)), or while the worker was still capturing the workload, which the worker then canceled.

  • atelet stages the snapshot files as hard links, so checkpoint-state keeps them until the commit, and a retry replaces an uncommitted local snapshot.
  • The workers finish CheckpointWorkload under the caller's deadline but not its cancellation.

TestRetriedCheckpointAfterUncommittedStaging and TestCheckpointContext cover the change, and the TestCheckpointBoundaryAudit fixture from #2836 passes all 15 cases, up from 9. The "pause move fails" row of TestFailedCheckpointKeepsLocalSnapshot is removed, since a leftover local snapshot directory is now replaced.

AI use: AI-assisted. I reviewed and tested it.

  • Tests pass

moveLocalCheckpoint renamed the files the worker reported out of
checkpoint-state before CommitLocal. If atelet died in between, the
retried Checkpoint found no committed snapshot, and the worker could not
answer from its completed checkpoint because the files had left
checkpoint-state. The worker then checkpointed a workload that no longer
existed.

Stage the files as hard links instead, so checkpoint-state keeps them
until atelet resets the actor's directories after the commit. A retry
also replaces a local snapshot directory that an interrupted attempt
published but never committed.

Signed-off-by: Chenyi Wang <[email protected]>
CheckpointWorkload ran under the caller's context. If atelet died during
runsc checkpoint or the cloud-hypervisor snapshot, the worker canceled
it partway and wrote no completion record. The retry from the restarted
atelet then checkpointed again and failed, because the first attempt had
already paused or stopped the workload.

Once CheckpointWorkload holds the actor's lock, it now runs under
CheckpointContext, which keeps the caller's deadline but not its
cancellation.

Signed-off-by: Chenyi Wang <[email protected]>

@HavenXia Haven Xia (HavenXia) 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.

This LGTM

@dberkov
Dmitry Berkovich (dberkov) added this pull request to the merge queue Oct 27, 2026
Merged via the queue into agent-substrate:main with commit 7e6476c Oct 27, 2026
6 checks passed
@chw120
Chenyi Wang (chw120) deleted the checkpoint-retry-after-atelet-restart branch October 27, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/gvisor area/microVM area/node area/reliability area/storage kind/bug Something isn't working / bugfixes milestone-ack prio/P0 Highest priority / required for next milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants