# NousResearch/hermes-agent · SessionDB writer lock contention affecting turn-lease renewal

## Open now

- 1 issue, 2 PRs open on GitHub.
- #139959: \[Bug\]: Turn-lease renewal starves behind the process-wide SessionDB writer lock under multi-worker load, hard-interrupting long healthy turns (session_turn_lease_lost)
- PR #139984: fix(state): prevent local writers from starving turn lease renewal
- PR #145813: fix(state): honor write patience when acquiring the writer mutex

These items center on turn-lease renewal being starved by the process-wide SessionDB writer lock under multi-worker load, with one bug report and two fix-oriented PRs addressing local writer starvation and write patience when acquiring the writer mutex. The titles suggest a shared theme, but they don't confirm the outcome of any change.

## TL;DR

- 3 member(s): 1 open issue(s), 0 closed issue(s), 2 open PR(s), 0 merged PR(s), 0 PR(s) closed without merging.
- No fix has been merged to main; one or more PRs were attempted (see below).
- **Recommended:** review the prior/competing PR(s) below. A fix was attempted but not merged; your case may extend or revive that work.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.67`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Open related issues

- #139959: \[Bug\]: Turn-lease renewal starves behind the process-wide SessionDB writer lock under multi-worker load, hard-interrupting long healthy turns (session_turn_lease_lost)

## Prior & competing PRs

- **#139984: fix(state): prevent local writers from starving turn lease renewal**. open
  - maintainer direction: category `merged_via`; implication `superseded`; refs `fa245276dde73275c7788a985c9400db7bc9cf61`
  - files: `hermes_state_compression.py`, `hermes_state_turn_lease_writer.py`, `tests/hermes_state/test_session_turn_lease.py`, `tests/hermes_state/test_turn_lease_writer_isolation.py`
- **#145813: fix(state): honor write patience when acquiring the writer mutex**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `e2e06d0864289a75ac50aa615334c4a21319f5dd`, `#145813`, `#149048`, `#110872`, `#105692`, `#45383`
  - files: `hermes_state.py`, `hermes_state_write.py`, `tests/hermes_state/test_clean_close_residual_poison.py`, `tests/hermes_state/test_writer_mutex_patience.py`

## Fix status

- No merged fix on record.
- Subsystem: `agent`
- Kind: `bug` (from the open issues' GitHub type labels).
