]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/.../replicated_request: fix op lifetime in with_pg finally
authorSamuel Just <sjust@redhat.com>
Wed, 8 Jan 2025 19:34:54 +0000 (11:34 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 10 Jan 2025 03:44:11 +0000 (03:44 +0000)
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 <sjust@redhat.com>
src/crimson/osd/osd_operations/replicated_request.cc

index ec607758c55fdd759f1dd132c550bf7b5e25a3f5..257d6779269dc25e0d30d96e833a318a8b63a175 100644 (file)
@@ -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)] {});
   });
 }