atelet: undo only the system-info registration a failed Run or Restore made - #1716
Open
Max Thompson (thompsonmax) wants to merge 1 commit into
Open
Max Thompson (thompsonmax) wants to merge 1 commit into
Max Thompson (thompsonmax) wants to merge 1 commit into
Conversation
…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.
Max Thompson (thompsonmax)
marked this pull request as ready for review
September 18, 2026 22:13
Max Thompson (thompsonmax)
requested review from
Taahir Ahmed (ahmedtd),
Julian Gutierrez Oschmann (juli4n) and
shrutiyam-glitch
September 18, 2026 22:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1714.
RunandRestoreundid a failed registration withDeregister(actorUID), which drops whatever entry the map holds for that UID. Since #1684 a retriedRestoresupersedes 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.Registernow returns a handle and the deferred undos callUndoon it.Undoremoves the entry only if the map still points at it, so a failed attempt cannot drop a later registration. ARegisterthat fails while writing its volumes also removes its own entry.Deregister(actorUID)is unchanged forTerminateandCheckpoint.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.gocover undo with and without a superseding registration, a failingRegisterleaving no entry, andUndomixed withDeregisterunder the race detector.