]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "crimson/osd/osd_operations/snaptrim_event: lifetime fixes"
authorMatan Breizman <mbreizma@redhat.com>
Mon, 27 Nov 2023 09:48:46 +0000 (09:48 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 9 Jan 2024 09:24:08 +0000 (09:24 +0000)
This reverts commit abceb1652239629ed11187a5fc670a3b1a3a5bb1.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/osd_operations/snaptrim_event.cc

index e90c7a213faf5a876828939ea4d554f505dee6bb..64b318580a473b794c37af6dd8645c5c0b64f9b9 100644 (file)
@@ -90,14 +90,7 @@ SnapTrimEvent::start()
 {
   ShardServices &shard_services = pg->get_shard_services();
   IRef ref = this;
-  return interruptor::with_interruption(
-    // SnapTrimEvent is a background operation,
-    // it's lifetime is not guarnteed since the caller
-    // returned future is being ignored. We should capture
-    // a self reference thourhgout the entire execution
-    // progress (not only on finally() continuations).
-    // See: PG::on_active_actmap()
-    [&shard_services, this, ref] {
+  return interruptor::with_interruption([&shard_services, this] {
     return enter_stage<interruptor>(
       client_pp().wait_for_active
     ).then_interruptible([this] {
@@ -200,8 +193,7 @@ SnapTrimEvent::start()
         });
       });
     });
-  }, [this, ref]
-     (std::exception_ptr eptr) -> snap_trim_ertr::future<seastar::stop_iteration> {
+  }, [this](std::exception_ptr eptr) -> snap_trim_ertr::future<seastar::stop_iteration> {
     logger().debug("{}: interrupted {}", *this, eptr);
     return crimson::ct_error::eagain::make();
   }, pg).finally([this, ref=std::move(ref)] {