diff --git a/tokio/src/runtime/io/driver/uring.rs b/tokio/src/runtime/io/driver/uring.rs index f828df314..3370164d1 100644 --- a/tokio/src/runtime/io/driver/uring.rs +++ b/tokio/src/runtime/io/driver/uring.rs @@ -289,7 +289,10 @@ impl Handle { match mem::replace(lifecycle, Lifecycle::Cancelled(cancel_data)) { Lifecycle::Submitted | Lifecycle::Waiting(_) => (), // The driver saw the completion, but it was never polled. - Lifecycle::Completed(_) => (), + Lifecycle::Completed(_) => { + // We can safely remove the entry from the slab, as it has already been completed. + ops.remove(index); + } prev => panic!("Unexpected state: {:?}", prev), }; }