Skip to content

Commit

Permalink
Handle io_setup error properly (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnZhong authored Nov 20, 2023
1 parent 35f8cf7 commit b2a595c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/linux_aligned_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,14 @@ void LinuxAlignedFileReader::register_thread()
if (ret != 0)
{
lk.unlock();
assert(errno != EAGAIN);
assert(errno != ENOMEM);
std::cerr << "io_setup() failed; returned " << ret << ", errno=" << errno << ":" << ::strerror(errno)
<< std::endl;
if (ret == -EAGAIN)
{
std::cerr << "io_setup() failed with EAGAIN: Consider increasing /proc/sys/fs/aio-max-nr" << std::endl;
}
else
{
std::cerr << "io_setup() failed; returned " << ret << ": " << ::strerror(-ret) << std::endl;
}
}
else
{
Expand Down

0 comments on commit b2a595c

Please sign in to comment.