Skip to content

Hold containerd instance snapshots under a lease until their container exists - #335

Merged
Shine-neko merged 2 commits into
mainfrom
fix/containerd-creation-lease
Nov 24, 2026
Merged

Shine-neko merged 2 commits into
mainfrom
fix/containerd-creation-lease

Conversation

@Shine-neko

Copy link
Copy Markdown
Contributor

Ring prepared an instance's writable snapshot with no lease and no gc.root label, so until CreateContainer referenced it nothing protected it from containerd's garbage collector. Any deletion on the same containerd (Ring itself, nerdctl, a Kubernetes node) triggers a collection across all namespaces, which removed the snapshot about 90 ms later; the task then failed on no such file or directory and the instance went to backoff.

The snapshot is now prepared under a ring-create-<instance> lease, deleted as soon as the container holds it or the creation fails. The lease carries containerd.io/gc.expire (10 minutes), so a creation Ring never finishes does not pin the snapshot forever.

@Shine-neko
Shine-neko merged commit 97ab130 into main Nov 24, 2026
6 checks passed
@Shine-neko
Shine-neko deleted the fix/containerd-creation-lease branch November 24, 2026 15:01
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