Repository navigation
fix(signaling): retain unacknowledged queueable requests - #1531
allenrchan wants to merge 4 commits into
Conversation
|
Follow-up on the current macOS CI failure: job 117340260244 exits with SIGSEGV in I tried to reproduce against a dedicated local LiveKit 1.13.9 server, matching CI's Rust 1.97.1, ARM64 target, CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 \
cargo +1.97.1 test --locked --target aarch64-apple-darwin \
-p livekit --features __lk-e2e-test --test reconnection_test \
-- --nocapture --test-threads=1
The reconnect test, engine/session and native WebRTC sources, manifests/lockfile and build config are unchanged by this PR. That does not rule out a timing-sensitive interaction. There is no confirmed crash root cause, and I have not disabled a test or added speculative native changes. Could a maintainer rerun only the failed macOS job on this head, retaining the macOS native crash report/backtrace if it recurs? This account has read-only upstream access and the scoped rerun command was refused. The local pass does not clear the failed hosted job. |
|
Added failure-only macOS reconnection crash-report retention in The test command, assertions, retries and failure status are unchanged. |
Problem
SignalInner::flush_queuedrains the whole pending queue before its writes have succeeded. A failed write therefore loses both the failed request and the unattempted tail. Separately, a connected queueable send can be cancelled while waiting for its write acknowledgement before the request has entered the pending queue.Change
This does not promise exactly-once delivery across ambiguous transport failures: an unacknowledged write may have reached the peer. A successfully acknowledged prefix is removed immediately and is not replayed.
Verification
Based on upstream main
5328bf6f9289939f7ec5d563765785f4918eddb1, using Rust 1.99.1 on macOS ARM64:track-a, track-a, track-binstead oftrack-a, track-b.cargo test --locked -p livekit-signaling --lib: 49 passed.cargo test --locked -p livekit-signaling --lib --features native,rustls-tls-webpki-roots: 49 passed.SignalStreamthroughWsConnection, recover on a fresh stream, and verify that closing releases the connection tasks. Cancellation waits for the external write to begin before aborting the caller.cargo fmt -p livekit-signaling --check: passed.cargo clippy --locked -p livekit-signaling --all-targets --features native,rustls-tls-webpki-roots --no-deps: passed with existing upstream warnings. No lint suppression or unrelated cleanup is included.-D warningsis not clean on untouched upstream: the same six library/test diagnostics occur on both this branch and its pristine base; including dependencies additionally stops on two existingdevice-infodead-code diagnostics.This is package-scoped qualification, not a full SDK/platform, native media, server-backed reconnect or application deployment acceptance claim.
Native CI follow-up
The Windows job on the previous head aborts in the existing
libwebrtc::imp::peer_connection::tests::set_bitratetest. Its stack reachescxxbridge1$exception/Cow<str>::into_ownedand aptr::copy_nonoverlappingprecondition failure; signaling tests have not yet run in that job.This PR does not change
libwebrtc,webrtc-sys, workspace manifests/lockfile, Cargo config, or the test workflow. The same test passed on the exact upstream base, with the same Rust 1.97.1, CXX 1.0.198 and MSVC versions. Windows and Linux tests on03737403now pass; no native change was made to achieve that result, so the previous Windows root cause is not claimed fixed.The remaining macOS job aborts with SIGSEGV in
test_resume_failure_escalates_to_full_reconnect, just after successful recovery. Local runs against LiveKit 1.13.9 with CI's Rust 1.97.1, ARM64 target, no incremental compilation and debug info disabled pass all seven reconnect tests on both03737403and untouched base5328bf6f. Ten additional exact-case LLDB diagnostic runs pass without reproducing the crash. An earlier Rust 1.99.1 run had a separate participant-reconciliation timeout and is not passing target proof. The SIGSEGV root cause remains unconfirmed; local results do not clear the hosted failure. No test is disabled and no speculative native repair is included. A maintainer rerun with a native crash report is needed because this contributor cannot rerun upstream jobs.