Skip to content

fix(node): preserve detached archives across failed starts - #439

Open
Floating-Y wants to merge 1 commit into
deeplethe:devfrom
Floating-Y:fix/detached-restore-retry
Open

Floating-Y wants to merge 1 commit into
deeplethe:devfrom
Floating-Y:fix/detached-restore-retry

Conversation

@Floating-Y

Copy link
Copy Markdown
Collaborator

A detached Create could unpack its archive successfully and then fail during boot. The leftover overlay mount or Firecracker disk blocked subsequent retries, while automatic reaping could delete the only recovery archive.

Rebuild failed local state from the retained archive before retrying Create, preserving the original prepare/boot errors and protecting live or snapshotted sandboxes. Automatic reaping releases local resources and networking while keeping the archive. Explicit Destroy still removes the archive and preserves the user volume.

Validation:

  • Added 7 regression tests covering both backends: direct retry, restart followed by automatic reaping, incomplete local layers, explicit Destroy, and snapshot protection.
  • Recovery tests read back the original contents of a file absent from the template.
  • The same tests reproduce 5 failures on unpatched d27ab7c.
  • All 207 node tests pass.
  • Formatting, diff checks, and Clippy across all targets and features pass.
  • Automatic reaping is triggered by adjusting bundle timestamps, without waiting 60 seconds.

Coverage: Firecracker uses real ext4 data, prepare/teardown, and tar/zstd I/O. gVisor prepare/mount/teardown and both backends' boot/exec are simulated. The production Create and automatic reaping paths are exercised.

Real guest startup and network resource release were not exercised (net_index=None). Retries rebuild from the saved archive, discarding local writes made during the failed startup.

Signed-off-by: danwood <118035379+Floating-Y@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

1 participant