]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix some list buckets handle leak 34985/head
authorTianshan Qu <tianshan@xsky.com>
Wed, 21 Aug 2019 04:33:37 +0000 (12:33 +0800)
committerNathan Cutler <ncutler@suse.com>
Mon, 11 May 2020 15:16:55 +0000 (17:16 +0200)
Fixes: https://tracker.ceph.com/issues/44283
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
(cherry picked from commit 8955ca2c0c804f6c43bb33c97bbe263bac1cc36d)

src/rgw/rgw_bucket.cc

index 2e1e8b39ac2adfb03f6205a9cbdf20eaf9fd79cc..c017418826e73ed357eff5247e44a7a01cfc0f54 100644 (file)
@@ -1655,6 +1655,7 @@ int RGWBucketAdminOp::info(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState
           formatter->dump_string("bucket", bucket_name);
       }
     }
+    store->ctl()->meta.mgr->list_keys_complete(handle);
 
     formatter->close_section();
   }
@@ -1811,6 +1812,11 @@ static int process_stale_instances(rgw::sal::RGWRadosStore *store, RGWBucketAdmi
   bool truncated;
 
   formatter->open_array_section("keys");
+  auto g = make_scope_guard([&store, &handle, &formatter]() {
+                              store->ctl()->meta.mgr->list_keys_complete(handle);
+                              formatter->close_section(); // keys
+                              formatter->flush(cout);
+                            });
 
   do {
     list<std::string> keys;
@@ -1836,8 +1842,6 @@ static int process_stale_instances(rgw::sal::RGWRadosStore *store, RGWBucketAdmi
     }
   } while (truncated);
 
-  formatter->close_section(); // keys
-  formatter->flush(cout);
   return 0;
 }