diff options
author | Casey Bodley <cbodley@redhat.com> | 2024-02-15 04:53:47 +0100 |
---|---|---|
committer | Casey Bodley <cbodley@redhat.com> | 2024-05-13 18:57:01 +0200 |
commit | 9dd892e289b32a90b24d55ab8e1b7d7601af21ca (patch) | |
tree | 1a1c0157205bb9d6adf0e3572b01f18f62d40916 /src/rgw/driver/rados/rgw_tools.cc | |
parent | rgw/aio: YieldingAioThrottle::async_wait() uses async_initiate (diff) | |
download | ceph-9dd892e289b32a90b24d55ab8e1b7d7601af21ca.tar.xz ceph-9dd892e289b32a90b24d55ab8e1b7d7601af21ca.zip |
rgw: switch back to boost::asio for spawn() and yield_context
a fork of boost::asio::spawn() was introduced in 2020 with spawn::spawn() from #31580. this fork enabled rgw to customize how the coroutine stacks are allocated in order to avoid stack overflows in frontend request coroutines. this customization was based on a StackAllocator concept from the boost::context library
in boost 1.80, that same StackAllocator overload was added to boost::asio::spawn(), along with other improvements like per-op cancellation. now that boost has everything we need, switch back and drop the spawn submodule
this required switching a lot of async functions from async_completion<> to async_initiate<>. similar changes were necessary to enable the c++20 coroutine token boost::asio::use_awaitable
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/driver/rados/rgw_tools.cc')
-rw-r--r-- | src/rgw/driver/rados/rgw_tools.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rgw/driver/rados/rgw_tools.cc b/src/rgw/driver/rados/rgw_tools.cc index 41254f9519e..eec4a799115 100644 --- a/src/rgw/driver/rados/rgw_tools.cc +++ b/src/rgw/driver/rados/rgw_tools.cc @@ -203,11 +203,10 @@ int rgw_rados_operate(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, con // given a yield_context, call async_operate() to yield the coroutine instead // of blocking if (y) { - auto& context = y.get_io_context(); auto& yield = y.get_yield_context(); boost::system::error_code ec; auto bl = librados::async_operate( - context, ioctx, oid, op, flags, trace_info, yield[ec]); + yield, ioctx, oid, op, flags, trace_info, yield[ec]); if (pbl) { *pbl = std::move(bl); } @@ -228,10 +227,9 @@ int rgw_rados_operate(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, con int flags, const jspan_context* trace_info) { if (y) { - auto& context = y.get_io_context(); auto& yield = y.get_yield_context(); boost::system::error_code ec; - librados::async_operate(context, ioctx, oid, op, flags, trace_info, yield[ec]); + librados::async_operate(yield, ioctx, oid, op, flags, trace_info, yield[ec]); return -ec.value(); } if (is_asio_thread) { @@ -248,10 +246,9 @@ int rgw_rados_notify(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, cons optional_yield y) { if (y) { - auto& context = y.get_io_context(); auto& yield = y.get_yield_context(); boost::system::error_code ec; - auto reply = librados::async_notify(context, ioctx, oid, + auto reply = librados::async_notify(yield, ioctx, oid, bl, timeout_ms, yield[ec]); if (pbl) { *pbl = std::move(reply); |