Skip to content

Commit c199a48

Browse files
committed
crimson/.../replicated_request: work around gcc 11 bug in with_pg_interruptible
Signed-off-by: Samuel Just <[email protected]>
1 parent fc52858 commit c199a48

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/crimson/osd/osd_operations/replicated_request.cc

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,21 @@ RepRequest::interruptible_future<> RepRequest::with_pg_interruptible(
7070
LOG_PREFIX(RepRequest::with_pg_interruptible);
7171
DEBUGI("{}", *this);
7272
co_await this->template enter_stage<interruptor>(repop_pipeline(*pg).process);
73-
co_await interruptor::make_interruptible(this->template with_blocking_event<
74-
PG_OSDMapGate::OSDMapBlocker::BlockingEvent
75-
>([this, pg](auto &&trigger) {
76-
return pg->osdmap_gate.wait_for_map(
77-
std::move(trigger), req->min_epoch);
78-
}));
73+
{
74+
/* Splitting this expression into a fut and a seperate co_await
75+
* works around a gcc 11 bug (observed on 11.4.1 and gcc 11.5.0)
76+
* which results in the pg ref captured by the lambda being
77+
* destructed twice. We can probably remove these workarounds
78+
* once we disallow gcc 11 */
79+
auto fut = interruptor::make_interruptible(
80+
this->template with_blocking_event<
81+
PG_OSDMapGate::OSDMapBlocker::BlockingEvent
82+
>([this, pg](auto &&trigger) {
83+
return pg->osdmap_gate.wait_for_map(
84+
std::move(trigger), req->min_epoch);
85+
}));
86+
co_await std::move(fut);
87+
}
7988

8089
if (pg->can_discard_replica_op(*req)) {
8190
co_return;

0 commit comments

Comments
 (0)