]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/.../client_request: complete_request() only in with_pg_process
authorSamuel Just <sjust@redhat.com>
Thu, 10 Oct 2024 00:59:20 +0000 (00:59 +0000)
committerSamuel Just <sjust@redhat.com>
Thu, 7 Nov 2024 18:29:42 +0000 (10:29 -0800)
This avoids needing to annotate every exit point in
with_pg_process_interruptible with complete_request.  Regardless of the
result, completing with_pg_process_interruptible without an interruption
means that the request is over.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/osd_operations/client_request.cc

index 368ee4eb2a2daaf4feb7355376f604096760ff7e..61a56600a57040bd1ec9b82185cbddc107cdefe4 100644 (file)
@@ -154,7 +154,6 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib
        std::ref(get_foreign_connection()), m->get_map_epoch()
       ));
     DEBUGDPP("{}: discarding {}", *pgref, *this, this_instance_id);
-    complete_request(pg);
     co_return;
   }
   DEBUGDPP("{}.{}: entering await_map stage",
@@ -243,7 +242,6 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib
   DEBUGDPP("{}.{}: process[_pg]_op complete,"
           "removing request from orderer",
           *pgref, *this, this_instance_id);
-  complete_request(pg);
 }
 
 seastar::future<> ClientRequest::with_pg_process(
@@ -260,7 +258,11 @@ seastar::future<> ClientRequest::with_pg_process(
   auto &ihref = *instance_handle;
   return interruptor::with_interruption(
     [this, pgref, this_instance_id, &ihref]() mutable {
-      return with_pg_process_interruptible(pgref, this_instance_id, ihref);
+      return with_pg_process_interruptible(
+       pgref, this_instance_id, ihref
+      ).then_interruptible([this, pgref] {
+       complete_request(*pgref);
+      });
     }, [FNAME, this, this_instance_id, pgref](std::exception_ptr eptr) {
       DEBUGDPP("{}.{}: interrupted due to {}",
               *pgref, *this, this_instance_id, eptr);