You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
menu.sh: ensure_hub_root's freshness fetch runs under a shared lock, not exclusive #1103
with_hub_read_lock holds hub_read_lock_acquire's shared lock (flock -s)
for its whole span, including ensure_hub_root's own freshness check, which
runs git fetch against the tentatively-reused hub checkout (host-setup/menu.sh,
around the git -C "$HUB_ROOT" fetch --quiet origin "$DEFAULT_REF" call). Since
a shared lock permits multiple concurrent holders, two sessions can run this git fetch against the same checkout at the same time, updating FETCH_HEAD and the remote-tracking ref concurrently.
Git's own fetch machinery has some internal locking (packed-refs, lock files
per ref), so this is not necessarily a data-corrupting race, but it is a
real, unreviewed concurrent-write hazard this reader/writer lock design was
not built to allow, and CodeRabbit rates it Major.
Suggested directions (not yet designed): move this specific fetch under
the exclusive lock (defeats some of the reader-concurrency the shared-lock
design exists for, since freshness verification happens on every read task,
not just an explicit fetch_hub call), or add a narrower, fetch-specific
lock distinct from the read/use lock this PR's own chain already introduced.
Deferred out of the PR #1091/#1098/#1100/#1102 chain as a heavier design
lift than that chain's own scope (closing concrete rule-6 git-command
bypasses and the reader/writer lock's own precision), tracked here for a
follow-up pass.
Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.
Activity
ptr727 commentedon Oct 23, 2026
Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.