Skip to content

fix(cleanup): compare container mounts as a set (restored from #614) - #626

Merged
Mola-maker merged 3 commits into
layerfs_v2_0_0from
claude/angry-goldberg-62c8a8
Nov 8, 2026
Merged

Mola-maker merged 3 commits into
layerfs_v2_0_0from
claude/angry-goldberg-62c8a8

Conversation

@Mola-maker

Copy link
Copy Markdown
Member

Restored PR from #614 targeting layerfs_v2_0_0. Fixes cleanup script comparing container mounts without ordering.

yifanxuaaa and others added 3 commits November 5, 2026 04:54
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The docker-container action records `docker inspect` identity at plan time
and compares it at apply time and again after recovery capture. Docker
returns `Mounts` in no fixed order, so an untouched exited container was
refused with "Container identity or execution state changed since plan"
(reproduced 2026-11-06 in the PostgreSQL round-2 cleanup, where the plan
and a fresh inspect differed only in mount order).

identity() now sorts Mounts by type, name, source and destination, and both
checks compare through same(), which normalizes the recorded side too, so
plans written before this change still apply. A changed image, state,
mount set or new process still refuses.

Tests: two inspect payloads that differ only in mount order pass the apply
check (new and old-format plans); a changed, missing or replaced mount, a
changed image or a changed state refuses before any Docker command. The
order test fails on the previous code. Full tools/test_cleanup.py: 46 OK.
docs/general/cleanup.md describes the identity comparison.

Production LOC: 102831 -> 102831 (delta 0)
Scope: tools/production_loc.py at the parent and staged tree (core 38395,
engine 61777, api 2659, dsh 0); tools-, test- and docs-only change.
Reference absent (retired R9c; last counted 65,417 at tree 498dd19).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mola-maker
Mola-maker merged commit 008cc85 into layerfs_v2_0_0 Nov 8, 2026
4 checks passed
@Mola-maker
Mola-maker deleted the claude/angry-goldberg-62c8a8 branch November 8, 2026 18:38
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.

2 participants