Skip to content

Commit

Permalink
reactor: print more informative error when io_submit fails
Browse files Browse the repository at this point in the history
when io_submit() fails with errno of ENOTSUP, there are good chances
that the application is sending i/o requests to a network filesystem
or a stacked filesystem. instead of printing

> seastar - io_submit: Operation not supported

let's print

> seastar - could not submit io. this happens when accessing filesystem which does not support asynchronous direct I/O

Refs #1947
Signed-off-by: Kefu Chai <[email protected]>

Closes #1949
  • Loading branch information
tchaikov authored and xemul committed Sep 6, 2024
1 parent e3249a8 commit 44cc54e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/reactor_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ aio_storage_context::handle_aio_error(linux_abi::iocb* iocb, int ec) {
// we will only remove it from _pending_io and try again.
return 1;
}
case EINVAL:
// happens when the filesystem does not implement aio read or write
[[fallthrough]];
case ENOTSUP: {
seastar_logger.error("io_submit failed: this happens when "
"accessing filesystem which does not supports "
"asynchronous direct I/O");
auto desc = get_user_data<kernel_completion>(*iocb);
_iocb_pool.put_one(iocb);
desc->complete_with(-ENOTSUP);
return 1;
}
default:
++_r._io_stats.aio_errors;
throw std::system_error(ec, std::system_category(), "io_submit");
Expand Down

0 comments on commit 44cc54e

Please sign in to comment.