the shared error code `ec` was not cleared before continuing
past a non-existent shard (ENOENT from get_meta). and if the last
shard returned ENOENT, `ec` retained that value and the
fired EIO even though all shards were cleanly removed.
also switch to sys::system_error(ec) to preserve the real errno
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
= co_await fifo::FIFO::get_meta(rados, oid, loc, std::nullopt,
asio::redirect_error(asio::use_awaitable,
ec));
- if (ec == sys::errc::no_such_file_or_directory) continue;
+ if (ec == sys::errc::no_such_file_or_directory) {
+ ec.clear();
+ continue;
+ }
if (!ec && info.head_part_num > -1) {
for (auto j = info.tail_part_num; j <= info.head_part_num; ++j) {
sys::error_code subec;
<< ": " << ec.message() << dendl;
}
}
- if (ec)
- throw sys::error_code(ec);
+ if (ec && ec != sys::errc::no_such_file_or_directory)
+ throw sys::system_error(ec);
co_return;
}