mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Background relay task now stores a per-waiter (Sender, Instant) deadline pair in BgState::ack_waiters. A new select arm in the main event loop fires at the earliest deadline, calling sweep_expired_ack_waiters — which removes every expired entry and sends Uncertain — so the map is provably empty on every path (timeout, socket failure, disconnect drain, late OK no-op) without requiring caller participation. Caller-side changes: register_publish_ack accepts the computed publish_deadline and forwards it to the background task via the PublishEventAcked command. The spawned ACP task no longer wraps ack_rx in a timeout_at; the relay bg task guarantees the channel resolves before the deadline. SENTINEL_PUBLISH_TIMEOUT_SECS promoted to pub(crate) so relay.rs can reference it in publish_event_acked's default deadline. Three frozen named tests added: - ack_waiter_disconnect_drain_all_uncertain_map_empty (relay.rs BgState unit) - ack_waiter_late_ok_after_cleanup_is_noop_map_stays_empty (relay.rs BgState unit) - ack_waiter_sweep_removes_expired_leaves_live (relay.rs BgState unit, start_paused) - sentinel_ack_deadline_during_publishing_never_admitted (acp.rs AcpClient integration) Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>