]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/.../replicated_request: work around gcc 11 bug in with_pg_interruptible 61267/head
authorSamuel Just <sjust@redhat.com>
Mon, 13 Jan 2025 19:47:36 +0000 (19:47 +0000)
committerSamuel Just <sjust@redhat.com>
Mon, 13 Jan 2025 19:47:36 +0000 (19:47 +0000)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/osd_operations/replicated_request.cc

index 0630e70b1ddefc2cf1a03442c3c17afaa90128fb..44ea0703cb7762287ff9bf3e9e384fb1ec2e379e 100644 (file)
@@ -70,12 +70,21 @@ RepRequest::interruptible_future<> RepRequest::with_pg_interruptible(
   LOG_PREFIX(RepRequest::with_pg_interruptible);
   DEBUGI("{}", *this);
   co_await this->template enter_stage<interruptor>(repop_pipeline(*pg).process);
-  co_await interruptor::make_interruptible(this->template with_blocking_event<
-    PG_OSDMapGate::OSDMapBlocker::BlockingEvent
-    >([this, pg](auto &&trigger) {
-      return pg->osdmap_gate.wait_for_map(
-       std::move(trigger), req->min_epoch);
-    }));
+  {
+    /* Splitting this expression into a fut and a seperate co_await
+     * works around a gcc 11 bug (observed on 11.4.1 and gcc 11.5.0)
+     * which results in the pg ref captured by the lambda being
+     * destructed twice.  We can probably remove these workarounds
+     * once we disallow gcc 11 */
+    auto fut = interruptor::make_interruptible(
+      this->template with_blocking_event<
+      PG_OSDMapGate::OSDMapBlocker::BlockingEvent
+      >([this, pg](auto &&trigger) {
+       return pg->osdmap_gate.wait_for_map(
+         std::move(trigger), req->min_epoch);
+      }));
+    co_await std::move(fut);
+  }
 
   if (pg->can_discard_replica_op(*req)) {
     co_return;