From: Xuehan Xu Date: Fri, 2 Jul 2021 04:05:02 +0000 (+0800) Subject: crimson/common: allow interruptible parallel_for_each to handle errorated future X-Git-Tag: v17.1.0~1479^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F42147%2Fhead;p=ceph.git crimson/common: allow interruptible parallel_for_each to handle errorated future Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index aa9f196cec9b..f9ec7bf4a3f1 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -12,6 +12,9 @@ namespace crimson::interruptible { +template +class parallel_for_each_state; + template class interruptible_future_detail; @@ -439,6 +442,8 @@ private: return std::move(maybe_handle_error).get_result(); } + protected: + using base_t::get_exception; public: using errorator_type = ::crimson::errorator; using promise_type = seastar::promise; @@ -717,6 +722,8 @@ private: template friend class ::crimson::interruptible::interruptible_future_detail; friend class ::crimson::parallel_for_each_state; + template + friend class ::crimson::interruptible::parallel_for_each_state; }; class Enabler {}; diff --git a/src/crimson/common/interruptible_future.h b/src/crimson/common/interruptible_future.h index 748154867abd..51b50f04ebb6 100644 --- a/src/crimson/common/interruptible_future.h +++ b/src/crimson/common/interruptible_future.h @@ -228,6 +228,79 @@ Result non_futurized_call_with_interruption( } } +template +struct interruptible_errorator; + +template +struct parallel_for_each_ret { + static_assert(seastar::is_future::value); + using type = seastar::future<>; +}; + +template