Repository navigation
Launcher: recover after a requested stop when the dead lock owner is its own stopped asset - #67
Merged
Merged
Conversation
…aster-lock owner is one of its own stopped assets A requested stop terminates the assets; an Urban car plant is the master and takes the lock every step, so a stop landing while it held the lock left it recorded as held by a dead owner and the next start fail-stopped. When the session ends TERMINATED, every managed process is stopped, and hako-cmd check reports ABORT with an owner this Launcher ran, run hako-cmd recover (it refuses while a recorded Hakoniwa process lives). FAILED sessions and foreign owners keep their evidence. 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.
Problem (found on a rebuilt Business Pack Foundation with Core 1.4.0 / hako-cmd 1.4.0): after a normal
stopof an Urban run,hako-cmd checkreported ABORT. The Urban car plant (urban-car-hakoniwa-asset) is the master and takes the master lock every step, so the Launcher's terminate landed while it held the lock. The nextstartwas refused as fail-stop, so Urban could not be started twice in a row. The formerruntime.cleanup_mmap_on_startused to hide this.Change (agreed with @tmori): a requested stop is not a crash. In
terminate(), when the session ends TERMINATED (not FAILED),_recover_after_normal_stop()runshako-cmd recoveronly if:hako-cmd checkreports ABORT;hako-cmd recoveritself still refuses while a recorded Hakoniwa process lives, which covers descendants on Windows, where descendant verification is unavailable. FAILED sessions and owners this Launcher did not run keep their evidence, as before.HakoCli.recover()was added for this.Verified:
normal stop: cleared the lock left by stopped asset(s) [46872] (hako-cmd recover).Follow-up for the proper fix (C++ assets releasing the lock on a stop signal): see #66.
🤖 Generated with Claude Code