webrtc-rs / webrtc

A pure Rust implementation of WebRTC
https://webrtc.rs
Apache License 2.0
4.08k stars 363 forks source link

fix panic on async task cancellation #570

Closed gmorer closed 4 months ago

gmorer commented 4 months ago

Hello, I got a panic while listening inside a tokio::select!, the other future completed first which end up in a cancellation of the webrtc future, and tokio::task::spawn_blocking then return an error.

thread 'tokio-runtime-worker' panicked at .../webrtc-sctp-0.9.1/src/association/mod.rs:514:22:
called `Result::unwrap()` on an `Err` value: JoinError::Cancelled(Id(1742443))

This change remove the panick.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 61.49%. Comparing base (dcfefd7) to head (f3e2964).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #570 +/- ## ========================================== - Coverage 61.61% 61.49% -0.13% ========================================== Files 531 531 Lines 48885 48751 -134 Branches 12289 12300 +11 ========================================== - Hits 30120 29978 -142 - Misses 9575 9581 +6 - Partials 9190 9192 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.