Skip to content

cache: keep a referenced equalImmutable on release - #7156

Draft
mmiller-sh wants to merge 1 commit into
moby:masterfrom
mmiller-sh:cache-fix-referenced-parent-removal
Draft

mmiller-sh wants to merge 1 commit into
moby:masterfrom
mmiller-sh:cache-fix-referenced-parent-removal

Conversation

@mmiller-sh

Copy link
Copy Markdown

Releasing a mutable also removes its equalImmutable. finalize clears the immutable's equalMutable but leaves mutable.equalImmutable pointing back at it, so an immutable that has since become another record's parent is removed while that record still lists it. The child is then stranded on a parent the manager no longer holds, and DiskUsage dies dereferencing it.

Only remove the equalImmutable when nothing else references it, matching the check GetMutable already makes.

Releasing a mutable also removes its equalImmutable. finalize clears the
immutable's equalMutable but leaves mutable.equalImmutable pointing back at
it, so an immutable that has since become another record's parent is removed
while that record still lists it. The child is then stranded on a parent the
manager no longer holds, and DiskUsage dies dereferencing it.

Only remove the equalImmutable when nothing else references it, matching the
check GetMutable already makes.

Signed-off-by: Matt Miller <matt@mattmiller.io>
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.

1 participant