From 321131660809c3f28c5956e4ea7512aeb0427a96 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 8 Jan 2025 11:34:54 -0800 Subject: [PATCH] crimson/.../replicated_request: fix op lifetime in with_pg finally 02b70a62a4 moved the call to handle.complete() into the finally, but didn't extend the op ref lifetime until after the complete resolved. Signed-off-by: Samuel Just --- src/crimson/osd/osd_operations/replicated_request.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/crimson/osd/osd_operations/replicated_request.cc b/src/crimson/osd/osd_operations/replicated_request.cc index ec607758c55..257d6779269 100644 --- a/src/crimson/osd/osd_operations/replicated_request.cc +++ b/src/crimson/osd/osd_operations/replicated_request.cc @@ -107,9 +107,10 @@ seastar::future<> RepRequest::with_pg( return with_pg_interruptible(pg); }, [](std::exception_ptr) { return seastar::now(); - }, pg, pg->get_osdmap_epoch()).finally([this, ref=std::move(ref)] { + }, pg, pg->get_osdmap_epoch()).finally([this, ref=std::move(ref)]() mutable { logger().debug("{}: exit", *this); - return handle.complete(); + return handle.complete( + ).finally([ref=std::move(ref)] {}); }); } -- 2.39.5