Skip to content

Name flock holders on the first store lock wait - #2902

Merged
trissim merged 1 commit into
mainfrom
fix/store-lock-wait-holders
Oct 23, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/store-lock-wait-holders

Conversation

@trissim

@trissim trissim commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

A contended store acquisition used to wait silently until success or timeout. It now writes one flushed stderr line on its first BlockingIOError, naming every flock holder, then continues through the existing contention budget and sync/async waiting paths.

IDEN-2: the general flock-holder mechanism was named and located as a route-only facility. Move that existing mechanism to Platform so the lower store layer and route refusal share it.

  • child_process.py:318 owns LockHolder (affix LockHolder) and its IdentifiedLockHolder, RunningLockHolder, ExitedLockHolder and UnidentifiedLockHolder members. Their description strings moved intact.
  • Platform.lock_holders at child_process.py:468 returns UnidentifiedLockHolder on platforms without a kernel owner reader.
  • LinuxPlatform.lock_holders at child_process.py:634 contains the one /proc/locks parser moved from active_route.py. It matches the opened descriptor's device/inode, reads command arguments through self.arguments(self.identity(pid)), and retains the existing exited/unidentified cases. No second cmdline reader or parser was added.
  • active_route.py's acquire_exclusive_route_lock calls Platform.current().lock_holders. Its refusal text is unchanged. The old family, free parser, and now-unused imports are deleted; there is no re-export or alias.
  • StoreLockContention.waits at store_files.py:82 keeps reported as a local per acquisition. On the first contention it prints "Waiting on a store lock held by " plus the holders' own descriptions, separated with "; ", to sys.stderr with flush=True. Both acquire and acquire_async use this existing generator. Timeout arithmetic, interval, retry, yield and sleep code remain unchanged. No environment switch or new exception fallback was added.

Base: origin/main da12825, which contains #2892 (merged as 5d331d0). EmptyCommandLockHolder was already deleted there because empty Linux cmdline is ProcessLookupError; it stays deleted rather than adding a dead family member.

Requested source/test/tool grep:

grep -rn "route_lock_holders\|RouteLockHolder" src tests tools
# no output; exit 1

Consumer search found no test imports of the moved family/parser and no test solely pinning the old name. No test changes were needed. AST inspection covered the declarations and consumers before editing; all three changed modules parse with zero omissions; git diff --check is clean. No test runs.

HARNESS-PLAN step 3's lock-wait bullet only. This does not claim the whole plan or an installed command qualification.

Assumed: do not resurrect EmptyCommandLockHolder after the #2892 correction. Existing Linux procfs lookup failures propagate; no catch masks a failed lookup as an empty holder set. The contention line is emitted on the first BlockingIOError, including an immediately exhausted budget, as the order specifies.

@trissim
trissim marked this pull request as ready for review October 23, 2026 20:47
Copilot AI balanced review requested due to automatic review settings October 23, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions

Copy link
Copy Markdown

debt-tools at a276ead, every finding:

grew StringIdentity:src/agent_comms/child_process.py +1

@github-actions

Copy link
Copy Markdown

debt-src at a276ead, every finding:

grew FamilyFlattened:src/agent_comms/child_process.py +1
grew LintFindings:src/agent_comms/active_route.py +1
grew StringIdentity:src/agent_comms/child_process.py +1
grew TypeErrors:src/agent_comms/child_process.py +2

@trissim
trissim merged commit 4ff4b5d into main Oct 23, 2026
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants