mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-28665 aio_uring::thread_routine terminates prematurely, causing hang
aio_uring::thread_routine(): Handle -EINTR from io_uring_wait_cqe() in the same way as aio_linux::getevent_thread_routine() does it: simply ignore it and invoke the system call again. Reviewed by: Vladislav Vaintroub
This commit is contained in:
parent
57e66dc7e6
commit
db0fde3f24
1 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2021, MariaDB Corporation.
|
/* Copyright (C) 2021, 2022, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute itand /or modify
|
This program is free software; you can redistribute itand /or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -137,8 +137,8 @@ private:
|
||||||
io_uring_cqe *cqe;
|
io_uring_cqe *cqe;
|
||||||
if (int ret= io_uring_wait_cqe(&aio->uring_, &cqe))
|
if (int ret= io_uring_wait_cqe(&aio->uring_, &cqe))
|
||||||
{
|
{
|
||||||
if (ret == -EINTR) // this may occur during shutdown
|
if (ret == -EINTR)
|
||||||
break;
|
continue;
|
||||||
my_printf_error(ER_UNKNOWN_ERROR,
|
my_printf_error(ER_UNKNOWN_ERROR,
|
||||||
"io_uring_wait_cqe() returned %d\n",
|
"io_uring_wait_cqe() returned %d\n",
|
||||||
ME_ERROR_LOG | ME_FATAL, ret);
|
ME_ERROR_LOG | ME_FATAL, ret);
|
||||||
|
@ -147,7 +147,7 @@ private:
|
||||||
|
|
||||||
auto *iocb= static_cast<tpool::aiocb*>(io_uring_cqe_get_data(cqe));
|
auto *iocb= static_cast<tpool::aiocb*>(io_uring_cqe_get_data(cqe));
|
||||||
if (!iocb)
|
if (!iocb)
|
||||||
break;
|
break; // ~aio_uring() told us to terminate
|
||||||
|
|
||||||
int res= cqe->res;
|
int res= cqe->res;
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue