mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
rt: flush CQE in case of CQE overflow (#8277)
This commit is contained in:
@@ -233,6 +233,18 @@ impl Driver {
|
|||||||
let mut guard = handle.get_uring().lock();
|
let mut guard = handle.get_uring().lock();
|
||||||
let ctx = &mut *guard;
|
let ctx = &mut *guard;
|
||||||
ctx.dispatch_completions();
|
ctx.dispatch_completions();
|
||||||
|
|
||||||
|
// There might be some cases where the CQ overflows, so we need to flush
|
||||||
|
// the remaining buffered CQEs.
|
||||||
|
while ctx
|
||||||
|
.uring
|
||||||
|
.as_mut()
|
||||||
|
.is_some_and(|uring| uring.submission().cq_overflow())
|
||||||
|
{
|
||||||
|
ctx.submit()
|
||||||
|
.expect("failed to flush io_uring completion queue overflow");
|
||||||
|
ctx.dispatch_completions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handle.metrics.incr_ready_count_by(ready_count);
|
handle.metrics.incr_ready_count_by(ready_count);
|
||||||
|
|||||||
Reference in New Issue
Block a user