]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/async: remove null_yield support for spawn_throttle
authorCasey Bodley <cbodley@redhat.com>
Tue, 22 Jul 2025 18:37:08 +0000 (14:37 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 28 Jul 2025 15:56:24 +0000 (11:56 -0400)
commit4956c638e61ab77470a935f254a46dc1b0ec4705
treeab973fcebd87ba0d56716655151d567724e6d9d5
parent1cefcae2a95402055f2f392a1dd0dce580a20d90
common/async: remove null_yield support for spawn_throttle

null_yield support was provided by sync_spawn_throttle_impl, which
itself stores the boost::asio::io_context that it runs on. however,
valgrind reports issues with object lifetimes

each spawn_throttle_handler holds a reference count on the
spawn_throttle_impl to prevent it from going away while coroutines are
in flight. on completion, this spawn_throttle_handler gets invoked on
its associated executor. this invocation may drop the last reference
to spawn_throttle_impl while that associated executor is still trying
to use the io_context that was destroyed with sync_spawn_throttle_impl

finding no good way for a custom executor to preserve the lifetime of
the spawn_throttle_impl, we instead remove support for this flawed
design. the null_yield callers must first spawn a parent coroutine
before using spawn_throttle

Fixes: https://tracker.ceph.com/issues/70965
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/async/detail/spawn_throttle_impl.h
src/common/async/spawn_throttle.h
src/test/common/test_async_spawn_throttle.cc