Repository navigation
fix(bin): bound wake drain presentation lock waits - #3475
Merged
kunchenguid merged 6 commits intoSep 2, 2026
Merged
Conversation
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "no-mistakes(ci): Added deterministic reg..." | Re-trigger Greptile |
…ul bounded-lock acquisition after live contention, verifying helper-to-caller PID ownership handoff and caller release. Verified with bash syntax checks, git diff checks, and the full fm-wake-queue test suite
kunchenguid
deleted the
fm/fm-startup-fix-b-presentation-lock-deadline-r1
branch
September 2, 2026 00:09
Intent
Startup fix B: bounded acquire for presentation-path locks (drain, status-presentation) that skips a pass with an advisory line on a live holder, mutation-critical locks keep blocking semantics, ack unchanged
What Changed
Risk Assessment
✅ Low: The change is bounded to presentation-path acquisition, preserves blocking acknowledgement paths, and handles live, stale, and malformed lock states consistently.
Testing
Targeted executable tests and a manual end-to-end CLI run confirmed both presentation locks time out cleanly with holder-specific advisories, skipped wakes remain retriable, malformed locks fail safely, and acknowledgement locking remains blocking and lossless.
Evidence: Bounded presentation-lock end-to-end CLI transcript
Source: Bounded presentation-lock end-to-end CLI transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (2) ✅
bin/fm-wake-drain.sh:412- Intent requires bounded acquisition for both presentation paths: “(drain, status-presentation)”. The initial drain still unconditionally callsfm_lock_acquire_waitbefore distinguishing acknowledgement mode. If a live process holds.wake-queue.lock, a normal no-ack startup drain blocks forever and emits no advisory. Use bounded acquisition for the no-ack presentation path while retaining blocking acquisition whenACK_THROUGHis set.bin/fm-wake-lib.sh:977- A timeout is always returned as live-holder contention, even when the lock is malformed or otherwise unrecoverable. For example, a regular file at.status-presentation-lockmakes every acquire fail without a holder; after the deadline this returns 124 and the caller reports a fictitious live PID, while status presentation remains skipped indefinitely. Return 124 only after validating a numeric, currently live holder; report other acquisition failures as lock errors.🔧 Fix: Distinguish malformed presentation locks from live contention
1 error still open:
bin/fm-wake-drain.sh:414- Intent requires “bounded acquire for presentation-path locks (drain, status-presentation)” while keeping mutation-critical and acknowledgement locking blocking. A normal no-ack drain still enters unconditionalfm_lock_acquire_wait "$FM_WAKE_QUEUE_LOCK"; with a live holder it blocks forever before reaching the bounded status-presentation acquire, so no pass is skipped and no advisory is emitted. At this initial boundary, use bounded acquisition for no-ack presentation drains while retaining blocking acquisition whenACK_THROUGHis set.🔧 Fix: Bound no-ack drain queue lock acquisition
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Focused execution oftest_live_presentation_holder_is_deadlined_without_weakening_ackfromtests/fm-wake-queue.test.shFocused execution oftest_malformed_presentation_lock_reports_acquire_failurefromtests/fm-wake-queue.test.shManual CLI verification with live queue and status lock holders: confirmed bounded skip advisories, intact durable queue, next-pass presentation, and successful acknowledgement✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix: Annotate bounded lock output global
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.