diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e64fc72e..eb63d1f9c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,11 +43,35 @@ jobs: name: Test (${{ matrix.target }}) runs-on: ${{ matrix.os }} steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install Rust toolchain run: | rustup update --no-self-update nightly rustup target add ${{ matrix.target }} --toolchain nightly + - name: Cache Cargo registry + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-registry- + + - name: Cache Cargo build + uses: actions/cache@v3 + with: + path: target/ + key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-build-${{ matrix.target }}- + ${{ runner.os }}-cargo-build- + - name: Install linux dependencies if: ${{ matrix.os == 'ubuntu-latest' }} run: | @@ -63,10 +87,6 @@ jobs: brew install livekit fi - - uses: actions/checkout@v3 - with: - submodules: true - - name: Run LiveKit server if: ${{ matrix.e2e-testing }} run: livekit-server --dev & diff --git a/livekit/src/rtc_engine/mod.rs b/livekit/src/rtc_engine/mod.rs index f3014e156..561cbaa25 100644 --- a/livekit/src/rtc_engine/mod.rs +++ b/livekit/src/rtc_engine/mod.rs @@ -450,6 +450,17 @@ impl EngineInner { match action { proto::leave_request::Action::Resume | proto::leave_request::Action::Reconnect => { + { + let running_handle = self.running_handle.read(); + + // server could have sent a leave & disconnected signal client + // we don't want to start another resume cycle + if !running_handle.can_reconnect { + return Ok(()); + } + // ensure we release the lock from this scope, it'll be used again in reconnection_needed + } + log::warn!( "received session close: {:?} {:?} {:?}", source,