mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-12-03 03:44:54 +00:00
Move the read-check-write of transition() inside a private monitor so concurrent callers can't both observe the same "from" state, both pass the transition-matrix check, and both write. Remove the now-redundant synchronized(stateMachine) wrapper around the streamCountJob check-and-call: with internal locking, a racing disconnect just causes the follow-up transition to be rejected as invalid and logged, which is the correct outcome. Adds a stress test that races CONNECTING -> CONNECTED and CONNECTING -> DISCONNECTED across 2000 rounds and asserts the end state is consistent with the winners returned by transition(). The test fails against the pre-fix implementation. Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bridge | ||
| mcp | ||
| testfixtures | ||
| tunnel | ||