Skip to content

fix: bump session lock wait to 3s so slow I/O does not race duplicates#115

Merged
George-iam merged 1 commit intomainfrom
fix/session-lock-timeout-wsl-20260417
Apr 17, 2026
Merged

fix: bump session lock wait to 3s so slow I/O does not race duplicates#115
George-iam merged 1 commit intomainfrom
fix/session-lock-timeout-wsl-20260417

Conversation

@George-iam
Copy link
Copy Markdown
Contributor

Summary

The concurrency test test/audit-dedup.test.tsensureAxmeSessionForClaude - parallel processes (E2E)5 parallel processes create exactly 1 session was intermittently failing on WSL2 (510 / 511) during the WSL2 E2E verification session. Root cause: LOCK_WAIT_MS = 500 is too short for slow-I/O systems — five npx tsx workers contend for the per-Claude-session file lock, the first one acquires it but is still writing its mapping when the other four time out at 500 ms, and each of those then creates its own AXME session.

Raised LOCK_WAIT_MS to 3000 ms.

  • Still bounded by the 5-second PreToolUse hook timeout in .claude/settings.json (leaves 2 s for the rest of the hook).
  • Still strictly less than LOCK_STALE_MS = 5000, so stale-lock recovery semantics are unchanged.
  • No change to the lock primitive, polling interval, or release path.

Test plan

  • Targeted run of the flaky test 10x on Linux — 11/11 each, all green.
  • Full npm test — 511/511 pass.
  • npx tsc --noEmit — clean.
  • npm run build — clean.

Context

Surfaced while running npm test inside WSL2 Ubuntu 22.04 on an Azure Win11 D2s_v5 VM as part of step 2 of the native-Windows-support rollout. The same test passes consistently on native Linux because native I/O completes well under 500 ms. See wsl2-full-e2e-verified-including-detached-audit-worker-2026-04-17 memory.

🤖 Generated with Claude Code

test/audit-dedup.test.ts 'ensureAxmeSessionForClaude - parallel
processes (E2E)' failed on WSL2 (510/511) because 5 npx-tsx workers
contending for the per-Claude-session lock could time out at 500ms
while the lock holder was still writing its mapping file, and each
then created its own AXME session. Raised LOCK_WAIT_MS to 3000ms —
stays within the 5s PreToolUse hook timeout and LOCK_STALE_MS, so
stale-lock recovery semantics are unchanged. 10 consecutive targeted
runs plus full 511/511 suite pass.

#!axme pr=none repo=AxmeAI/axme-code
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.

1 participant