Skip to content

atelet: undo only the system-info registration a failed Run or Restore made - #1716

Open
Max Thompson (thompsonmax) wants to merge 1 commit into
agent-substrate:mainfrom
thompsonmax:atelet-systeminfo-undo-handle
Open

Max Thompson (thompsonmax) wants to merge 1 commit into
agent-substrate:mainfrom
thompsonmax:atelet-systeminfo-undo-handle

Conversation

@thompsonmax

@thompsonmax Max Thompson (thompsonmax) commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1714.

Run and Restore undid a failed registration with Deregister(actorUID), which drops whatever entry the map holds for that UID. Since #1684 a retried Restore supersedes the first attempt's entry, so the first attempt's error path could delete the retry's live registration. The new sandbox then stopped receiving trust bundle refreshes with nothing logged.

Register now returns a handle and the deferred undos call Undo on it. Undo removes the entry only if the map still points at it, so a failed attempt cannot drop a later registration. A Register that fails while writing its volumes also removes its own entry. Deregister(actorUID) is unchanged for Terminate and Checkpoint.

This does not cover a second attempt that supersedes the first and then fails at ateom while the first sandbox is still alive. #1372 is the long-term fix for that.

Tests

New unit tests in cmd/atelet/systeminfovolume_test.go cover undo with and without a superseding registration, a failing Register leaving no entry, and Undo mixed with Deregister under the race detector.

…e made

Register supersedes an existing entry for the same actor UID, but the
failure paths in Run and Restore still undid their work with
Deregister(actorUID), which removes whatever entry the map holds. When
a retried Restore had already replaced the first attempt's entry, the
first attempt's error path deleted the retry's live registration, and
the running sandbox silently stopped receiving trust bundle refreshes.

Register now returns a handle scoped to the entry it created. Undo
removes that entry only if it is still the actor's current one and
marks it stale, so a failed attempt cannot drop a later registration.
A Register that fails while writing its volumes removes its own entry
before returning. Deregister keeps its by-UID semantics for Terminate
and Checkpoint, where the caller means whatever is registered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/node kind/bug Something isn't working / bugfixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

atelet: Run/Restore failure paths deregister system-info volumes by UID and can drop a newer live registration

2 participants