Repository navigation
fix: clean up failed shutdown without releasing active ownership early - #6
Merged
Merged
Conversation
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.
Closing the station can fail while persisting an active task's
interruptedstate. Previously that exception skipped SQLite cleanup and the closed flag, retaining database ownership even after the old worker stopped and allowing its late callback to mutate evidence.Wrap the existing shutdown write in
try/finally: close storage and reject late callbacks even after a failed commit, preserve the original database error when cleanup succeeds, and keep ownership until the active worker or legacy operation exits. The two-second join, other service methods, protocol requests and database schema are unchanged.Validation: 6 new regressions use native temporary SQLite trigger/write-lock faults, actual OS ownership, late callbacks, concurrent closers and restart/no-replay controls. Final fixtures produce 5 failures/1 pass before the fix; 24 focused tests and the full 427 local suite pass afterward. Configuration validation, 23 offline self-checks and 39 source Python syntax checks pass. Broad coverage is 54.37% of lines and 43.68% of branches; no complete coverage or field-hardware certification is claimed. Existing transport tests are loopback/Fake only.
Implementation, tests, documentation and independent review are AI-assisted. No physical device, production database, network deployment or dependency change is involved.