You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: serialise commit, and stop two refusals claiming nothing changed
Two findings from a Castle review of the restart-marker work.
commit/1 composed materialise-then-commit at the boundary with no lock, so a
duplicate install of the version being committed could configure it between
the two steps: the commit succeeds, that install then fails as already
installed, and its configuration is what the newly permanent release boots on
the next restart. A failed caller deciding what a successful one boots, which
is the failure this protocol exists to prevent, through the one operation
still outside the serialised region.
The reason it was left outside does not hold. AGENTS.md called putting commit
behind the install lock a deadlock dressed as caution, because an install
waiting on a reboot is when a commit is wanted - but an install never holds
the lock across a reboot. install_release/1 replies before init:reboot(), the
reboot runs in release_handler's process, and after a restart transition the
VM that held the lock is gone. The only thing commit can wait for is a hot
install still inside install_release/1, where waiting is correct.
So Commands.commit/5 takes rel_dir and materialises inside serialised/2, and
the refusal an ERTS-less deployment used to hear from commit changes from
naming the configuration step to naming commit itself. That asymmetry was the
visible symptom of the composition, and erts_guard_test now pins the new
direction, so a reappearance means a composition came back at the boundary.
Separately, arm/4's occupied and stale refusals both claimed nothing had been
changed. Materialisation runs before arming, so the target's configuration has
already been replaced by then and the claim was false. They now say what did
and did not happen. unclaimed/3's refusal keeps the phrase, because it fires
before materialising and there it is true.
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments