From 270560b089fa0ea03f42b1fb612f7fd025ebc6f0 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Tue, 31 Jan 2023 14:49:53 -0500 Subject: [PATCH] rgw: clean up January 23, 2023 coverity scan issues There were: * two cases of a destructor encountering an unhandled exception and * one case of an instance variable in a coroutine not being initialized in the constructor. Signed-off-by: J. Eric Ivancich --- src/rgw/driver/rados/rgw_data_sync.cc | 2 +- src/rgw/services/svc_mdlog.cc | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/rgw/driver/rados/rgw_data_sync.cc b/src/rgw/driver/rados/rgw_data_sync.cc index cae231965a30..df952ef08e64 100644 --- a/src/rgw/driver/rados/rgw_data_sync.cc +++ b/src/rgw/driver/rados/rgw_data_sync.cc @@ -5624,7 +5624,7 @@ class RGWSyncBucketCR : public RGWCoroutine { rgw_raw_obj error_repo; rgw_bucket_shard source_bs; rgw_pool pool; - uint64_t current_gen; + uint64_t current_gen = 0; RGWSyncTraceNodeRef tn; diff --git a/src/rgw/services/svc_mdlog.cc b/src/rgw/services/svc_mdlog.cc index 3ff306e97635..09a68d3d7132 100644 --- a/src/rgw/services/svc_mdlog.cc +++ b/src/rgw/services/svc_mdlog.cc @@ -133,8 +133,15 @@ class SysObjReadCR : public RGWSimpleCoroutine { : RGWSimpleCoroutine(_svc->ctx()), dpp(_dpp), async_rados(_async_rados), svc(_svc), obj(_obj), result(_result), empty_on_enoent(empty_on_enoent), objv_tracker(objv_tracker) {} + ~SysObjReadCR() override { - request_cleanup(); + try { + request_cleanup(); + } catch (const boost::container::length_error_t& e) { + ldpp_dout(dpp, 0) << "ERROR: " << __func__ << + ": reference counted object mismatched, \"" << e.what() << + "\"" << dendl; + } } void request_cleanup() override { @@ -209,7 +216,13 @@ class SysObjWriteCR : public RGWSimpleCoroutine { } ~SysObjWriteCR() override { - request_cleanup(); + try { + request_cleanup(); + } catch (const boost::container::length_error_t& e) { + ldpp_dout(dpp, 0) << "ERROR: " << __func__ << + ": reference counted object mismatched, \"" << e.what() << + "\"" << dendl; + } } void request_cleanup() override {