From: licc Date: Tue, 7 Feb 2023 07:31:44 +0000 (+0100) Subject: rgw:log_list_init() catches IoCtx::nobjects_begin() exceptions X-Git-Tag: v18.1.0~351^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14176f00f44d51b7ecbf9952a1fbbe056f7988eb;p=ceph.git rgw:log_list_init() catches IoCtx::nobjects_begin() exceptions Signed-off-by: lichaochao --- diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 4edcd4817db3f..067ea9ca6e946 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -1422,10 +1422,21 @@ int RGWRados::log_list_init(const DoutPrefixProvider *dpp, const string& prefix, delete state; return r; } - state->prefix = prefix; - state->obit = state->io_ctx.nobjects_begin(); - *handle = (RGWAccessHandle)state; - return 0; + try { + state->prefix = prefix; + state->obit = state->io_ctx.nobjects_begin(); + *handle = (RGWAccessHandle)state; + return 0; + } catch (const std::system_error& e) { + r = -e.code().value(); + ldpp_dout(dpp, 10) << "nobjects_begin threw " << e.what() + << ", returning " << r << dendl; + return r; + } catch (const std::exception& e) { + ldpp_dout(dpp, 10) << "nobjects_begin threw " << e.what() + << ", returning -5" << dendl; + return -EIO; + } } int RGWRados::log_list_next(RGWAccessHandle handle, string *name)