quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Fix panic on concurrent read_datagram completion #1455

Closed Ralith closed 1 year ago

Ralith commented 1 year ago

The previous logic assumed that a datagram must be available if the future was notified, but this might not be the case if e.g. two futures are concurrently waiting for datagrams, but only one datagram has been received, since we use notify_waiters to wake all waiting futures to be robust in the face of cancellation.

Fixes #1454.

djc commented 1 year ago

How hard would it be to add a test for this?

Ralith commented 1 year ago

Added test.