]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: do not re-init Rados in RadosRealmWatcher 67287/head
authorNithya Balachandran <nithya.balachandran@ibm.com>
Tue, 10 Feb 2026 15:53:20 +0000 (15:53 +0000)
committerNithya Balachandran <nithya.balachandran@ibm.com>
Tue, 10 Feb 2026 15:53:20 +0000 (15:53 +0000)
The RadosRealmWatcher::watch_start() function incorrectly
reinitialized a rados client that had already been initialized during
the creation of the ConfigStore. This caused the original Objecter
to be lost, which was subsequently reported as a memory leak by Valgrind.

Signed-off-by: Nithya Balachandran <nithya.balachandran@ibm.com>
src/rgw/driver/rados/config/realm_watcher.cc

index 0d6fb0cd2b68b7d6b4de10efc748032954306a21..d06bbe3f8ec3583fac7432c9a2e0fe3658813cdc 100644 (file)
@@ -85,23 +85,10 @@ int RadosRealmWatcher::watch_start(const DoutPrefixProvider* dpp,
                                    librados::Rados& rados,
                                    const RGWRealm& realm)
 {
-  // initialize a Rados client
-  int r = rados.init_with_context(cct);
-  if (r < 0) {
-    ldpp_dout(dpp, -1) << "Rados client initialization failed with "
-        << cpp_strerror(-r) << dendl;
-    return r;
-  }
-  r = rados.connect();
-  if (r < 0) {
-    ldpp_dout(dpp, -1) << "Rados client connection failed with "
-        << cpp_strerror(-r) << dendl;
-    return r;
-  }
-
+  // The Rados client should have been initialized by the ConfigStore
   // open an IoCtx for the realm's pool
   rgw_pool pool(realm.get_pool(cct));
-  r = rgw_init_ioctx(dpp, &rados, pool, pool_ctx);
+  int r = rgw_init_ioctx(dpp, &rados, pool, pool_ctx);
   if (r < 0) {
     ldpp_dout(dpp, -1) << "Failed to open pool " << pool
         << " with " << cpp_strerror(-r) << dendl;