Skip to content

Commit

Permalink
MDEV-25760: Resubmit IO job on -EAGAIN from io_uring
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
dr-m committed Jun 14, 2021
1 parent 74a0a98 commit 28e362e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tpool/aio_liburing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ class aio_uring final : public tpool::aio

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;
Expand Down

0 comments on commit 28e362e

Please sign in to comment.