From a4b357c10d581d3c97d4a47f6210c6c00ba409fb Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Mon, 27 Nov 2023 09:48:46 +0000 Subject: [PATCH] Revert "crimson/osd/osd_operations/snaptrim_event: lifetime fixes" This reverts commit abceb1652239629ed11187a5fc670a3b1a3a5bb1. Signed-off-by: Matan Breizman --- src/crimson/osd/osd_operations/snaptrim_event.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/crimson/osd/osd_operations/snaptrim_event.cc b/src/crimson/osd/osd_operations/snaptrim_event.cc index e90c7a213faf5..64b318580a473 100644 --- a/src/crimson/osd/osd_operations/snaptrim_event.cc +++ b/src/crimson/osd/osd_operations/snaptrim_event.cc @@ -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( client_pp().wait_for_active ).then_interruptible([this] { @@ -200,8 +193,7 @@ SnapTrimEvent::start() }); }); }); - }, [this, ref] - (std::exception_ptr eptr) -> snap_trim_ertr::future { + }, [this](std::exception_ptr eptr) -> snap_trim_ertr::future { logger().debug("{}: interrupted {}", *this, eptr); return crimson::ct_error::eagain::make(); }, pg).finally([this, ref=std::move(ref)] { -- 2.39.5