From 28e362eaca169ad49a2212a1ba6d5eca263e42c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 14 Jun 2021 08:57:04 +0300 Subject: [PATCH] MDEV-25760: Resubmit IO job on -EAGAIN from io_uring The server still may abort if there is no enough free space in the ring buffer to resubmit the IO job, but the behavior is equal to the failure of os_aio() -> submit_io(). --- tpool/aio_liburing.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tpool/aio_liburing.cc b/tpool/aio_liburing.cc index bdc3601ae35..430c01c91a0 100644 --- a/tpool/aio_liburing.cc +++ b/tpool/aio_liburing.cc @@ -162,6 +162,13 @@ private: io_uring_cqe_seen(&aio->uring_, cqe); + if (res == -EAGAIN) { + // If we need to resubmit the IO operation, but the ring is full, + // then just go the same path as for any other error codes. + if (!aio->submit_io(iocb)) + continue; + } + iocb->m_internal_task.m_func= iocb->m_callback; iocb->m_internal_task.m_arg= iocb; iocb->m_internal_task.m_group= iocb->m_group;