Repository navigation
fix: distinguish lock creation failures from contention - #5798
Open
florinteodorescu wants to merge 1 commit into
Open
florinteodorescu wants to merge 1 commit into
florinteodorescu wants to merge 1 commit into
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.
Intent
Stop the recurring Bash SIGSEGVs observed on this Omarchy machine, explain the root cause, and keep Firstmate safe: core evidence showed process-event reconciliation recursively trying longer .steal lock paths when lock-owner storage could not be created. Treat real lock-creation failures distinctly from ordinary lock contention so valid waiters and stale-lock recovery still work; add behavior regressions for both. The user specifically cautioned against breaking Firstmate and requested independent Sol review before an upstream PR.
What Changed
.stealpaths..stealafter failed stale recovery.Risk Assessment
✅ Low: The change is narrowly scoped to propagating lock-owner directory creation failures while preserving contention retries and stale-lock cleanup.
Testing
The focused lock suite passed, and isolated live CLI runs confirmed stale-recovery creation errors return cleanly with
.stealremoved while ordinary live contention waits and then registers successfully..stealbehind.tests/fm-watcher-lock.test.sh.stealholder has temporarily removed the primary lock waits, then succeeds after the holder releases it.tests/fm-watcher-lock.test.shEvidence: Live process-event source-lock CLI transcript
Source: Live process-event source-lock CLI transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
bin/fm-wake-lib.sh- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Review** - passed
✅ No issues found.
🔧 **Test** - 1 issue found → no changes applied ✅
.steal, return the creation error and release the mutex..steal, return the creation error and release the mutex.bash tests/fm-watcher-lock.test.shand marks this scenario live=false, so it does not establish a result against the live product.bash tests/fm-watcher-lock.test.shLive CLI registration with read-only lock-owner storage, bounded bytimeout 4Live CLI registration while a separate process held the source lock, then released itLive CLI registration against a dead-owner lock withFM_LOCK_STALE_AFTER=0Verified the worktree remained clean after testing🔧 No changes applied.
✅ Re-checked - no issues remain.
.stealbehind.tests/fm-watcher-lock.test.sh.stealholder has temporarily removed the primary lock waits, then succeeds after the holder releases it.tests/fm-watcher-lock.test.shtests/fm-watcher-lock.test.shLivebin/fm-procevent.sh register quota live-failure -- truewith owner-directory creation fault-injected on stale recoveryLivebin/fm-procevent.sh register quota live-contention -- truewhile a process held the real.steallock and then released itgit diff --check d1a332cdd4b9483ae0c43e9cf33684fadce28869 76091c68c586376cef128b72730da1dc13d01ef0✅ **Document** - passed
✅ No issues found.
🔧 No changes applied.
1 warning still open:
✅ **Push** - passed
✅ No issues found.