]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: start operations asynchrously
authorXuehan Xu <xxhdx1985126@gmail.com>
Wed, 8 Mar 2023 05:52:00 +0000 (05:52 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 21 May 2023 09:41:49 +0000 (09:41 +0000)
Fixes: https://tracker.ceph.com/issues/58928
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
(cherry picked from commit a1963937e421bfdaf2e9735dc2faf750c9a9e08e)

src/crimson/osd/shard_services.h

index 3cf807e8ca34a3b10658efeea061463ebc054288..43cbd2144e5fed1cac22a4072fb3fee160fd52c9 100644 (file)
@@ -132,11 +132,13 @@ class PerShardState {
     auto op = registry.create_operation<T>(std::forward<Args>(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));
   }