cultmesh-rs: close and Drop stay in bounds during a reconnect; close/Drop tests proven, not slept (h4) #198

Merged
eureka merged 5 commits from hands/rs-subscribe-members-h4 into main 2026-11-28 12:59:09 +00:00
Owner

Fixes the eight findings of verdict cultlib-gaps:verdict:cut-rs-subscribe-members.s3 (steward decision: close() waits up to 500 ms for the acknowledgement and reports it; Drop is best effort).

  • close-drop-block-in-reconnect: close and Drop set a closing flag the pump's connect loop polls, so a reconnect to an unresponsive peer ends within one poll instead of connect_timeout. The test proves the pump is inside open() (the silent peer has seen its Connect); red first at 3.01 s.
  • stall-proven-by-sleep: peer.stall() returns once the peer thread has entered the stall; the 100 ms sleeps are gone.
  • drop-unsubscribes-untested: a live peer observes Drop's unsubscribes.
  • close-survivors-untested: close() now returns the pump thread's join result (no reply channel, no second give-up timer). Tests pin early return on acknowledgement, the goodbye, the join and false after the session ended.
  • drain-weight-untested, refusal-during-wait-untested: tests added.
  • module-doc-omits-close: module Lifetime paragraph and struct doc corrected.
  • pump-liveness-public-hook: pump_liveness and its fields are behind a test-hooks feature that the crate's own tests enable through a dev-dependency on itself (a #[cfg(test)] item is invisible to integration tests). Cargo.lock gains the self entry.

Not done: the duplicated id check between the ErrorV1 guard and catalog_refused (the finding's side remark) is left.

🤖 Generated with Claude Code

Fixes the eight findings of verdict `cultlib-gaps:verdict:cut-rs-subscribe-members.s3` (steward decision: `close()` waits up to 500 ms for the acknowledgement and reports it; `Drop` is best effort). - close-drop-block-in-reconnect: close and Drop set a closing flag the pump's connect loop polls, so a reconnect to an unresponsive peer ends within one poll instead of `connect_timeout`. The test proves the pump is inside `open()` (the silent peer has seen its Connect); red first at 3.01 s. - stall-proven-by-sleep: `peer.stall()` returns once the peer thread has entered the stall; the 100 ms sleeps are gone. - drop-unsubscribes-untested: a live peer observes Drop's unsubscribes. - close-survivors-untested: `close()` now returns the pump thread's join result (no reply channel, no second give-up timer). Tests pin early return on acknowledgement, the goodbye, the join and false after the session ended. - drain-weight-untested, refusal-during-wait-untested: tests added. - module-doc-omits-close: module Lifetime paragraph and struct doc corrected. - pump-liveness-public-hook: `pump_liveness` and its fields are behind a `test-hooks` feature that the crate's own tests enable through a dev-dependency on itself (a `#[cfg(test)]` item is invisible to integration tests). `Cargo.lock` gains the self entry. Not done: the duplicated id check between the ErrorV1 guard and `catalog_refused` (the finding's side remark) is left. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The pump's reconnect waited out connect_timeout inline, so close() gave up at its
reply bound and then joined anyway, and Drop joined the whole wait. close and Drop
now set a closing flag the connect loop polls; the reconnect ends within one poll.
The test proves the pump is inside open() (the silent peer has seen its Connect).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
peer.stall() now returns once the peer's thread has entered the stall, so the close
and Drop tests meet a peer proven silent; the two 100 ms sleeps that stood in for
that proof are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A live peer observes the unsubscribes a dropped client sends, one per live id and none
for an id already unsubscribed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cultmesh-rs: close's result is the pump's; pin close and drain weight; docs; test seam off the API
Some checks failed
Rust crates / cargo test, fmt, clippy (pull_request) Has been cancelled
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
1d06c3bdf8
- close() takes the acknowledgement from the pump thread's join result: no reply
  channel, no second 1 s give-up, and returning before the pump ended is not
  expressible (close-survivors-untested). Tests pin the early return on
  acknowledgement, the goodbye, the join, and false after the session ended.
- A test pins that try_drain releases the weight of each event (drain-weight-untested)
  and that a refused subscribe is a fault while a catalog request is in flight
  (refusal-during-wait-untested).
- The module Lifetime paragraph names close() and Drop's best effort; the struct doc
  no longer says methods never block on the network (module-doc-omits-close).
- pump_liveness is behind the crate's own test-hooks feature, enabled for its tests by
  a dev-dependency on itself, so a consumer's API does not carry it
  (pump-liveness-public-hook).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cultmesh-rs: the pump's liveness guard is _alive, so test-hooks builds don't warn it is never read
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 26m59s
Rust crates / cargo test, fmt, clippy (pull_request) Successful in 8m18s
00200222e3
Closes cultlib-gaps:finding:cut-rs-subscribe-members.s4.alive-dead-code-warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eureka merged commit 453b360f61 into main 2026-11-28 12:59:09 +00:00
eureka deleted branch hands/rs-subscribe-members-h4 2026-11-28 12:59:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/CultLib!198
No description provided.