Skip to content

office kill and the host connection writer share one lock per host record #748

Closed

Description

@tps-flint

Follow-up from the 2026-11-05 post-merge audit of #722, verified against main e9074be (after #738). #738 made office kill remove a host record only when it is byte-identical to the one it re-read; the host connection writer (writeHostState, packages/cli/src/utils/connection-state.ts) and the connector's own shutdown (clearHostState) take no lock, so the two sides are not serialized.

What the fix does: tps office kill and the host connection writer take one shared lock per host state record, and office kill holds it across its final re-read and removal, so a record is removed only when it is byte-identical to the one office kill classified. The connector's own shutdown removes its record under the same lock and only when the record still names its own process.

Test: a deterministic test that writes a successor record between office kill's final re-read and its removal (via the existing test seams) shows the successor is kept and handled (signalled in a later pass or reported), not removed; the existing #738 tests stay green.

Priority: LOW (a live connector rewrites its record on its next heartbeat).

Activity

  1. moved this to Triage in Office queueon Nov 5, 2026
  2. self-assigned this
    on Nov 6, 2026
  3. moved this from Triage to In review in Office queueon Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions