From: Xuehan Xu Date: Wed, 8 Mar 2023 05:52:00 +0000 (+0000) Subject: crimson/osd: start operations asynchrously X-Git-Tag: v19.0.0~1258^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a1963937e421bfdaf2e9735dc2faf750c9a9e08e;p=ceph.git crimson/osd: start operations asynchrously Fixes: https://tracker.ceph.com/issues/58928 Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/osd/shard_services.h b/src/crimson/osd/shard_services.h index 90a06bb90cc0..79ea0db5fa6f 100644 --- a/src/crimson/osd/shard_services.h +++ b/src/crimson/osd/shard_services.h @@ -132,11 +132,13 @@ class PerShardState { auto op = registry.create_operation(std::forward(args)...); crimson::get_logger(ceph_subsys_osd).info( "PerShardState::{}, {}", __func__, *op); - auto fut = op->start().finally([op /* by copy */] { - // ensure the op's lifetime is appropriate. It is not enough to - // guarantee it's alive at the scheduling stages (i.e. `then()` - // calling) but also during the actual execution (i.e. when passed - // lambdas are actually run). + auto fut = seastar::yield().then([op] { + return op->start().finally([op /* by copy */] { + // ensure the op's lifetime is appropriate. It is not enough to + // guarantee it's alive at the scheduling stages (i.e. `then()` + // calling) but also during the actual execution (i.e. when passed + // lambdas are actually run). + }); }); return std::make_pair(std::move(op), std::move(fut)); }