fix(websocket): lossless EOF signal + pending sweep (WS-02, CON-02)

- Replace the axum/tungstenite pump paths' Notify-based read-EOF signal
  with a retained tokio watch channel: a late subscriber (monitor
  spawned after session setup, or pump EOF before the receiver is
  taken) still observes EOF (WS-02).
- from_wss drop monitor: on EOF (or session close) fail all pendings
  retryable, then keep sweeping the pending map every 1 s — calls
  registered after the initial fail_all (the forgotten-session import
  path) resolve instead of hanging (CON-02).
- Tests: drop-during-registration race variants (forget + held
  session) and a post-EOF registration resolved via the sweep; the
  existing no-hang test stays green.

cargo test (219), cargo test --features wss (231, 3x for flake check),
cargo clippy --all-targets -- -D warnings, cargo fmt --check
This commit is contained in:
2026-08-29 09:36:34 +00:00
parent 5ff88756eb
commit a9ac6f6cbd
4 changed files with 223 additions and 42 deletions
+3 -2
View File
@@ -18,8 +18,9 @@ pub use byte_adapter::{
#[cfg(any(test, feature = "wss"))]
pub use byte_adapter::split_tungstenite_to_bytes;
#[cfg(feature = "wss")]
pub(crate) use byte_adapter::wait_for_eof;
#[cfg(any(test, feature = "wss"))]
#[allow(unused_imports)]
pub(crate) use upgrade::adapter_install_channel_zero;
pub use upgrade::{run_channels_session, ws_bearer_auth, ws_upgrade_handler};
#[cfg(any(test, feature = "test-support"))]