cli: own an explicit --log before the session starts; a lock read that fails is a problem row - #23
Merged
Merged
Conversation
…t fails is a problem row `lion chat --log X` checked that X did not exist and then started the session; the log was created later, when the console first wrote. Two starts naming the same path in that window both passed the check and shared one log. The path is now created here, exclusively, as `fresh_log` does for the automatic name, and a second start naming it is refused; a start that fails before anything is logged removes the log it created, which is now the only log it can have. `_held` read every failed `flock` as a holder, and an `os.open` or `os.read` that failed escaped `resident`, so one resident's unreadable pid file took the whole table down. Only a refused shared lock is a holder now; any other failure raises, and `resident` writes it on that resident's row as its problem, serving false, pid unknown. `controls_info` reads the same failure as busy, so a restart takes `force` rather than cutting a wake short on a guess. Two help strings and one ADR pointer said what the code does not: the patch is applied with plain `git apply`, the areas registry carries `chair` and `desks`, and the `lion context` command's tests are in tests/test_context.py.
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.
Three things the source review of the app part turned up (records
89a5bcb4,51130218).--logis owned before the session starts.lion chat --log Xchecked that X did not exist and then started the session; the log was created later, by the console's first write, so two starts naming one path in that window shared a log. The path is now created here, exclusively, asfresh_logdoes for the automatic name; a second start naming it is refused, and a start that fails before anything is logged removes the log it created, which is now the only log it can have._heldread every failedflockas a live holder, and anos.openoros.readthat failed escapedresident, so one resident's unreadable pid file took every row down. Only a refused shared lock is a holder now; any other failure raises,residentwrites it on that row (agent.pid: <error>, serving false, pid unknown), and the control surface reads it as busy, so a restart takesforcerather than cutting a wake short on a guess.git apply, the areas registry carrieschairanddesks, and thelion contextcommand's tests are intests/test_context.py.Tests: the log exists at session entry and a second start naming it is refused; a lock call failing with
ENOLCKand a pid file that cannot be opened each land on their own row while the other resident keeps its row, with a working-lock control between. Both arms fail on the code before this change.