Repository navigation
fix(cleanup): compare container mounts as a set - #614
Merged
Merged
Conversation
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
added a commit
that referenced
this pull request
Nov 8, 2026
…626) * docs(readme): point to layerfs_v2_0_0 for 2.0.0 development Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs(readme): move the 2.0.0 branch note below the badges Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(cleanup): compare container mounts as a set 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> --------- Co-authored-by: YifanXu1999 <yifanxu1999@gmail.com> Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the cleanup script refusing an untouched exited container with "Container identity or execution state changed since plan".
Why
The
docker-containeraction recordsdocker inspectidentity at plan time, then compares it at apply time and again after recovery capture. Docker returnsMountsin no fixed order, so plan and apply could differ only in mount order and the action was refused.Change
identity()sortsMountsby type, name, source and destination.same(), which also normalizes the recorded side, so plans written before this change still apply.docs/general/cleanup.mddescribes the identity comparison.Tests
tools/test_cleanup.py: 46 OK (re-run 2026-11-08 at this head, 22 s).Production LOC: 102831 -> 102831 (delta 0). This is tooling only.
layerfs_v2_0_0has the same comparison (tools/cleanup_docker.py) and needs the same fix separately.🤖 Generated with Claude Code