Skip to content

common/async: remove null_yield support for spawn_throttle - #64624

Merged
adamemerson merged 5 commits into
ceph:mainfrom
cbodley:wip-70965
Jul 31, 2025
Merged

adamemerson merged 5 commits into
ceph:mainfrom
cbodley:wip-70965

Conversation

@cbodley

@cbodley cbodley commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

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

Show available Jenkins commands

@cbodley
cbodley requested a review from a team as a code owner July 22, 2025 19:04
@cbodley
cbodley requested a review from adamemerson July 22, 2025 19:05
@cbodley

cbodley commented Jul 24, 2025

Copy link
Copy Markdown
Contributor Author

https://jenkins.ceph.com/job/ceph-pull-requests/163333/

src/common/async/max_concurrent_for_each.h:61:19: error: no matching constructor for initialization of 'spawn_throttle'
   61 |   auto throttle = spawn_throttle{y, max_concurrent, on_error};
      |                   ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i guess max_concurrent_for_each() won't be able to support null_yield either

@cbodley

cbodley commented Jul 24, 2025

Copy link
Copy Markdown
Contributor Author

@adamemerson

Copy link
Copy Markdown
Contributor

i think qa looks ok in https://pulpito.ceph.com/cbodley-2025-07-23_18:05:36-rgw-wip-70965-distro-default-smithi/, but holy valgrind

Feel free to merge. I had an idea for the valgrind I'm going to try out.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@cbodley

cbodley commented Jul 28, 2025

Copy link
Copy Markdown
Contributor Author

rebasing over conflicts from #63348

cbodley added 5 commits July 28, 2025 11:56
if called with null_yield, RGWDeleteMultiObj::execute() creates an
io_context and spawns a coroutine to run on it. this ensures that
spawn_throttle always gets a valid yield context

Signed-off-by: Casey Bodley <[email protected]>
init_watch() and finalize_watch() use spawn_throttle for concurrent
operations, so need to spawn a parent coroutine unless init_watch()
already has one

Signed-off-by: Casey Bodley <[email protected]>
max_concurrent_for_each() is a thin wrapper around spawn_throttle.
remove its support for null_yield too

Signed-off-by: Casey Bodley <[email protected]>
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 <[email protected]>
spawn_throttle_impl was a virtual base class for the sync_ and async_
variants. with the sync variant removed, combine the classes into one
and remove the use of virtual functions

Signed-off-by: Casey Bodley <[email protected]>
@cbodley

cbodley commented Jul 28, 2025

Copy link
Copy Markdown
Contributor Author

https://jenkins.ceph.com/job/ceph-pull-requests-arm64/78104/

The following tests FAILED:
208 - unittest_bluefs (Bus error)
209 - unittest_bluefs_ex (Failed)
211 - unittest_bdev (Bus error)

@cbodley

cbodley commented Jul 28, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@cbodley

cbodley commented Jul 29, 2025

Copy link
Copy Markdown
Contributor Author

https://jenkins.ceph.com/job/ceph-pull-requests-arm64/78114/

The following tests FAILED:
208 - unittest_bluefs (Bus error)
209 - unittest_bluefs_ex (Failed)
211 - unittest_bdev (Bus error)

@cbodley

cbodley commented Jul 29, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@cbodley

cbodley commented Jul 29, 2025 •

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Jul 29, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

1 similar comment
@cbodley

cbodley commented Jul 30, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@cbodley

cbodley commented Jul 30, 2025

Copy link
Copy Markdown
Contributor Author

https://jenkins.ceph.com/job/ceph-pull-requests-arm64/78261/

The following tests FAILED:
32 - run-rbd-unit-tests-61.sh (Timeout)
262 - unittest_rbd_mirror (Subprocess aborted)

@cbodley

cbodley commented Jul 30, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@adamemerson

Copy link
Copy Markdown
Contributor

projectroot.src.test.rbd_mirror.unittest_rbd_mirror

@adamemerson

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@cbodley

cbodley commented Jul 30, 2025

Copy link
Copy Markdown
Contributor Author

jenkins pls

https://jenkins.ceph.com/job/ceph-pull-requests-arm64/78274/

The following tests FAILED:
208 - unittest_bluefs (Bus error)
209 - unittest_bluefs_ex (Failed)
211 - unittest_bdev (Bus error)

@cbodley

cbodley commented Jul 30, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@cbodley

cbodley commented Jul 31, 2025

Copy link
Copy Markdown
Contributor Author

https://jenkins.ceph.com/job/ceph-pull-requests-arm64/78290/

The following tests FAILED:
208 - unittest_bluefs (Bus error)
209 - unittest_bluefs_ex (Failed)
211 - unittest_bdev (Bus error)

@cbodley

cbodley commented Jul 31, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants