Repository navigation
fix(bin): return 124 on retriable bounded lock contention - #8119
Conversation
[Medium impact] The PR appears safe to merge; retriable timeouts still refuse acquisition and leave protected work untouched. Reviews (2) · Last reviewed commit: "no-mistakes(review): Return 124 when bou..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thank you @Azd325 for picking up #8105 so quickly. The fix is the right shape. After the deadline, an empty pid, an exited holder, or a lock that is already gone now returns Contract-class (my own read): restore. The function's documented contract is "124 means retry later", and VISION.md: aligns throughout. It removes a false hard failure (honest interface, fewer pointless wakes), the classification stays in the script, malformed locks still refuse, and nothing touches vendors, scope or authority. Waiting on you for one thing: the no-mistakes attestation on After that, we run the full suite. The |
Preserve retry-later status after an unpublished or exited lock holder at the deadline. Keep malformed lock records as hard failures and cover each classification with deterministic lock fixtures. Closes kunchenguid#8105
d2ce106 to
e9e9a08
Compare
|
Speaking as Kun's firstmate: thank you @Azd325 for the quick re-raise. On head I've added the |
|
Speaking as Kun's firstmate: this is merged. Thank you @Azd325 for the fix and for the quick clean re-raise. Bounded lock waits now return |
…d#8119) * Fix retriable bounded lock deadline races Preserve retry-later status after an unpublished or exited lock holder at the deadline. Keep malformed lock records as hard failures and cover each classification with deterministic lock fixtures. Closes kunchenguid#8105 * no-mistakes(review): Return 124 when bounded lock is released
…d#8119) * Fix retriable bounded lock deadline races Preserve retry-later status after an unpublished or exited lock holder at the deadline. Keep malformed lock records as hard failures and cover each classification with deterministic lock fixtures. Closes kunchenguid#8105 * no-mistakes(review): Return 124 when bounded lock is released
What Changed
fm_lock_acquire_wait_boundedinbin/fm-wake-lib.shnow returns 124 for any retriable contention at the deadline: a live holder, an unpublished holder pid, an exited holder, or a lock released during the wait. Before, only a live holder gave 124 and the other cases returned 1.FM_LOCK_HELD_PIDis set only when a live holder is known. A malformed pid or a non-directory lock path still returns 1.tests/fm-watcher-lock.test.shfor the deadline cases: unpublished holder, exited holder, released lock, live holder, and malformed lock.Risk Assessment
✅ Low: The change is confined to the deadline branch of one helper: unpublished, exited and released holders now return 124, and malformed pid data, non-directory locks and a removed parent still fail hard. Each test mode reaches the branch it names, because the live steal mutex in the fixture blocks the final acquire.
Testing
The watcher-lock test file ran with no failures, including the five bounded-deadline cases. An unstubbed probe against the real function returned 124 for both a live holder (pid advertised) and an unpublished-pid lock (no pid). Before the change, the unpublished case returned 1.
Evidence: watcher lock test log
Source: watcher lock test log
Evidence: real function probe
Source: real function probe
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-watcher-lock.test.sh(bounded-deadline cases: unpublished, exited, released, live, malformed/file)Unstubbed probe of the real function with a live sleeping holder and with an unpublished-pid lock dir✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Issues
Closes #8105