Skip to content

Various ref counting fixes - #6820

Merged
tonistiigi merged 3 commits into
moby:masterfrom
tonistiigi:various-ref-counting-fixes
Jun 2, 2026
Merged

tonistiigi merged 3 commits into
moby:masterfrom
tonistiigi:various-ref-counting-fixes

Conversation

@tonistiigi

Copy link
Copy Markdown
Member

No description provided.

ExecOp.Exec's post-exec commit loop returned (nil, err) when
mutable.Commit failed mid-loop, leaving the already-committed outputs
in the named `results` return clobbered to nil with no holder -- a
permanent leak.

Release them inline instead. An internal commit failure is not a
user-facing exec error, so they don't belong in ExecError.Mounts
either.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
The error defer's active-commit loop wrapped the commit error into the
outer err but skipped releasing active.Ref via `continue`. The mutable
was neither put into execMounts nor released, leaking on each failed
Commit.

Release before continue.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
RefManager.Commit nilled m.mr unconditionally, so Mount.Release became
a no-op on the failure path while the underlying cache.MutableRef was
never released. Release on failure before clearing m.mr.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi
tonistiigi merged commit fa04d2e into moby:master Jun 2, 2026
234 of 236 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants