Question: What happens to unsnapshotted rootfs data after OOM or abnormal container termination?

Author: lingdieCreated Sep 16, 2026Updated Sep 16, 2026

Question: What happens to unsnapshotted rootfs data after OOM or abnormal container termination?

Hi OpenSandbox team,

I’m currently evaluating the snapshot / pause-resume mechanism in OpenSandbox, especially the rootfs snapshot flow based on committing the container filesystem into an OCI image.

From my understanding, the current rootfs snapshot flow is roughly:

running sandbox
    ↓
sync / pause container
    ↓
commit writable layer
    ↓
create OCI image
    ↓
push to registry
    ↓
snapshot becomes durable

This works well when the sandbox is still running and a snapshot is explicitly triggered.

However, I’m wondering about the behavior in abnormal termination scenarios, for example:

  • the sandbox container is OOMKilled
  • the main process crashes
  • the Pod enters Failed
  • the Pod is evicted
  • kubelet restarts the container
  • the node temporarily loses connectivity
  • the sandbox process terminates before a snapshot request is issued

Suppose a sandbox has modified its container writable layer:

base image
    +
container writable layer
    ├── /workspace/project
    ├── installed packages
    └── other filesystem changes

but no snapshot has been created yet.

If the container is then OOMKilled or otherwise terminated unexpectedly:

  1. Does OpenSandbox currently provide any mechanism to preserve or recover the writable layer of the terminated container?

  2. If the container still exists in containerd and its snapshot has not yet been garbage-collected, can OpenSandbox create an OCI snapshot from that terminated container after the failure?

  3. Does the current snapshot implementation require the sandbox/container to still be in the Running state?

  4. If Kubernetes restarts the container, is the previous writable layer considered lost from the OpenSandbox lifecycle perspective?

  5. Is there any planned support for automatic snapshotting when a sandbox enters a failed/terminated state?

  6. More generally, is the intended durability model:

explicit snapshot
    = durable

unsnapshotted container writable layer
    = best-effort / disposable

or is there another recovery mechanism that I may have missed?

Motivation

For long-running coding / agent sandboxes, users may keep important changes inside the container rootfs for some time before explicitly creating a snapshot.

In that case, an OOM or unexpected Pod termination could potentially lose all changes made since the last snapshot.

I’d like to understand whether OpenSandbox intentionally treats the container writable layer as ephemeral between explicit snapshots, or whether crash recovery of that writable layer is already supported or planned.

Thanks!

Source: opensandbox-group/OpenSandbox