From: Samuel Just Date: Mon, 13 Jan 2025 19:47:36 +0000 (+0000) Subject: crimson/.../replicated_request: work around gcc 11 bug in with_pg_interruptible X-Git-Tag: testing/wip-hyelloji-testing-20250121.140335~1^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c199a48f807266179c382b5a261a02c0a3ab41c7;p=ceph-ci.git crimson/.../replicated_request: work around gcc 11 bug in with_pg_interruptible 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 0630e70b1dd..44ea0703cb7 100644 --- a/src/crimson/osd/osd_operations/replicated_request.cc +++ b/src/crimson/osd/osd_operations/replicated_request.cc @@ -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(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;