]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWSI_RADOS::Pool::List::init() catches IoCtx::nobjects_begin() exceptions 59360/head
authorlicc <lichaochao2_yewu@cmss.chinamobile.com>
Tue, 7 Feb 2023 08:02:19 +0000 (09:02 +0100)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Tue, 20 Aug 2024 13:01:58 +0000 (20:01 +0700)
Signed-off-by: lichaochao <lichaochao2_yewu@cmss.chinamobile.com>
(cherry picked from commit 63c7d2a44b421cb95bb62ec3db9b2ff84e72d059)

src/rgw/services/svc_rados.cc

index 1617a2ec6c611ffcc78d620b1aff416d5404b256..9cc22762eb6fc310f34e5c7ccf8dbd906bfcb506 100644 (file)
@@ -329,11 +329,21 @@ int RGWSI_RADOS::Pool::List::init(const DoutPrefixProvider *dpp, const string& m
     return -EINVAL;
   }
 
-  ctx.iter = ctx.ioctx.nobjects_begin(oc);
-  ctx.filter = filter;
-  ctx.initialized = true;
-
-  return 0;
+  try {
+    ctx.iter = ctx.ioctx.nobjects_begin(oc);
+    ctx.filter = filter;
+    ctx.initialized = true;
+    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 RGWSI_RADOS::Pool::List::get_next(const DoutPrefixProvider *dpp,