Skip to content

refactor(engine): collapse tile-lane lock boilerplate; document mutex-poison policy - #399

Merged
Kohei-Wada merged 1 commit into
mainfrom
refactor/mutex-poison-policy
Jul 24, 2026
Merged

refactor(engine): collapse tile-lane lock boilerplate; document mutex-poison policy#399
Kohei-Wada merged 1 commit into
mainfrom
refactor/mutex-poison-policy

Conversation

@Kohei-Wada

Copy link
Copy Markdown
Owner

Closes #310, closes #86.

  • lane.rs: lock_queue / lock_in_flight helpers on SharedState replace 9 repeated .lock().expect("tile worker mutex poisoned") sites (tests included).
  • docs/design.md: new Mutex poison = process death section — rationale, scope, and the grep-able "<tag> mutex poisoned" message convention. The error-boundary section's "out of scope — Document mutex-poison policy in design.md #86 owns it" placeholder now links here.
  • Site audit (per Document mutex-poison policy in design.md #86 acceptance): ttymap-lua/src/api/map.rs zoom/center mirrors keep .expect (internal view state → policy applies); ttymap-lua/src/host.rs help-entry skip stays as the documented loss-tolerable exception.

🤖 Generated with Claude Code

https://claude.ai/code/session_019Ktx7C4Zf26MhQABaPNYze

…-poison policy

lane.rs: lock_queue / lock_in_flight helpers replace 9 repeated
.lock().expect("tile worker mutex poisoned") sites.

design.md: new "Mutex poison = process death" section — rationale,
scope (internal worker mutexes crash; loss-tolerable data like help
entries may skip), and the grep-able message convention. Replaces the
error-boundary section's "out of scope, #86 owns it" placeholder.

Site audit: lua api/map.rs zoom/center mirrors keep expect (policy);
host.rs help-entry skip stays as the documented exception.

Closes #310
Closes #86

@amazon-q-developer amazon-q-developer Bot 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.

This PR successfully consolidates mutex-locking boilerplate and documents the mutex-poison policy. The refactoring correctly replaces 9 repeated .lock().expect() sites with two helper methods (lock_queue and lock_in_flight), and the new documentation section clearly explains the rationale for crashing on mutex poisoning. All changes are consistent with the documented policy. No blocking issues found.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@Kohei-Wada
Kohei-Wada merged commit c581c13 into main Jul 24, 2026
5 checks passed
@Kohei-Wada
Kohei-Wada deleted the refactor/mutex-poison-policy branch July 24, 2026 14:00
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.

refactor(engine): collapse tile worker mutex lock boilerplate Document mutex-poison policy in design.md

1 participant