From: Samuel Just Date: Fri, 10 Jan 2025 03:44:45 +0000 (+0000) Subject: crimson/.../replicated_request: hold pg ref until complete() resolves X-Git-Tag: testing/wip-hyelloji-testing-20250121.140335~1^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fc52858487715724bad64b97d38a914a69a36efc;p=ceph-ci.git crimson/.../replicated_request: hold pg ref until complete() resolves 02b70a62a4 moved the call to complete() into the finally block, so we need to hold a reference to the pg until the complete() resolves. Signed-off-by: Samuel Just --- diff --git a/src/crimson/osd/osd_operations/replicated_request.cc b/src/crimson/osd/osd_operations/replicated_request.cc index 257d6779269..0630e70b1dd 100644 --- a/src/crimson/osd/osd_operations/replicated_request.cc +++ b/src/crimson/osd/osd_operations/replicated_request.cc @@ -107,10 +107,11 @@ 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)]() mutable { + }, pg, pg->get_osdmap_epoch() + ).finally([this, pg, ref=std::move(ref)]() mutable { logger().debug("{}: exit", *this); return handle.complete( - ).finally([ref=std::move(ref)] {}); + ).finally([ref=std::move(ref), pg=std::move(pg)] {}); }); }