From 6dce7df4407e922affd99fbb0d471d300cfbf1d2 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Tue, 13 Dec 2022 13:28:43 +0000 Subject: [PATCH] crimson/osd: simplify SnapTrimObjSubEvent::start() Throwing away the NOP-looking-like `maybe_delay` concept became possible after eradication of the `with_interruption` call nested within `SnapTrimSubEvent`. Before, on Ubuntu and GCC 11.2.1, lack of it was the reson behind assertion failures on resetting the `thread_local` intteruption condition. Signed-off-by: Radoslaw Zarzynski --- src/crimson/osd/osd_operations/snaptrim_event.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/crimson/osd/osd_operations/snaptrim_event.cc b/src/crimson/osd/osd_operations/snaptrim_event.cc index 1e7dcda761a..73d02d98408 100644 --- a/src/crimson/osd/osd_operations/snaptrim_event.cc +++ b/src/crimson/osd/osd_operations/snaptrim_event.cc @@ -199,16 +199,9 @@ SnapTrimObjSubEvent::remove_or_update_iertr::future<> SnapTrimObjSubEvent::start() { logger().debug("{}: start", *this); - - IRef ref = this; - auto maybe_delay = seastar::now(); - if (auto delay = 0; delay) { - maybe_delay = seastar::sleep( - std::chrono::milliseconds(std::lround(delay * 1000))); - } - return maybe_delay.then([this] { - return with_pg(pg->get_shard_services(), pg); - }).finally([ref=std::move(ref), this] { + return with_pg( + pg->get_shard_services(), pg + ).finally([ref=IRef{this}, this] { logger().debug("{}: complete", *ref); return handle.complete(); }); -- 2.39.5