cultmesh-rs: the final wake only releases a waiter; no drain promise (final-wake-drain-unreachable)
Steward decision (coordinator, 2026-11-29): close and Drop consume the client, so nothing can try_drain after the last wake. The docs now say the last wake releases a blocked waiter, which learns the client is gone from a Weak that no longer upgrades. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4cd51e150f
commit
7eb16a6249
1 changed files with 12 additions and 10 deletions
|
|
@ -19,16 +19,18 @@
|
|||
//! coalescing is the consumer's; and it must not block, because a slow wake delays the pump and so RUDP acks and
|
||||
//! resends. A panic in it is caught and discarded, payload included even when the payload's own drop panics: the
|
||||
//! pump survives and the event stays queued. (Under `panic = "abort"` a panicking wake aborts the process: nothing
|
||||
//! can catch it.) It may call
|
||||
//! `try_drain`, `subscribe`, `unsubscribe` or `resubscribe_all`; the closure exists before the client does, so it
|
||||
//! reaches the client through a `Weak` (or a slot filled after `connect_with_wake` returns) and should hold it only
|
||||
//! weakly: if the owner drops its handle while the wake holds an upgraded one, the wake's handle is the last, and
|
||||
//! `Drop` then runs on the pump thread. There it signals the pump to end and does not join (a thread cannot join
|
||||
//! itself), so the pump ends once the wake returns. A wake that held a strong handle for good would keep the client,
|
||||
//! and so the pump, alive forever. It runs once more when the pump thread ends, after
|
||||
//! `close` or `Drop` has sent the unsubscribes and the goodbye, and never again: a consumer blocked in its own wait
|
||||
//! on another thread is released within the bounds above (500 ms of acknowledgement wait, a poll interval, and a
|
||||
//! reconnect abandoned at its next poll) and its next `try_drain` returns what the pump had queued.
|
||||
//! can catch it.) It may call `try_drain`, `subscribe`, `unsubscribe` or `resubscribe_all`. The closure exists
|
||||
//! before the client does, so it reaches the client through a `Weak` (or a slot filled after `connect_with_wake`
|
||||
//! returns) and should hold it only weakly: if the owner drops its handle while the wake holds an upgraded one,
|
||||
//! the wake's handle is the last, and `Drop` then runs on the pump thread. There it signals the pump to end and
|
||||
//! does not join (a thread cannot join itself), so the pump ends once the wake returns. A wake that held a strong
|
||||
//! handle for good would keep the client, and so the pump, alive forever.
|
||||
//!
|
||||
//! The wake runs once more when the pump thread ends, after `close` or `Drop` has sent the unsubscribes and the
|
||||
//! goodbye, and never again. Both consume the client, so by then there is nothing left to `try_drain`: that last
|
||||
//! wake only releases a consumer blocked on its own wait (on another thread, within the bounds above: 500 ms of
|
||||
//! acknowledgement wait, a poll interval, and a reconnect abandoned at its next poll), which learns the client is
|
||||
//! gone from its own handle, a `Weak` that no longer upgrades. What the pump had queued ends with the client.
|
||||
//!
|
||||
//! Bounds: the assembler bounds what it holds of incomplete commits and faults the connection past that. What the
|
||||
//! caller has not drained is bounded too, by [`CultMeshRudpSubscriptionOptions::max_undrained`], counted in
|
||||
|
|
|
|||
Loading…
Reference in a new issue