]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw/notify: process_queue() constructs wait tokens when spawning
authorCasey Bodley <cbodley@redhat.com>
Thu, 15 Aug 2024 17:58:30 +0000 (13:58 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 15 Aug 2024 18:04:49 +0000 (14:04 -0400)
commitdee230c26d4fe894cb0d700e85cee37cd5c00a6c
tree1c2af244712c0f017e2d295d1f2eeed3be35e910
parentdbcd88835cbd4aabf153469cde0bacb3eb461941
rgw/notify: process_queue() constructs wait tokens when spawning

process_queue() spawns several coroutines, then waits on a tokens_waiter
until all of them complete

but spawned coroutines don't start immediately. if we call
waiter.async_wait() before any of the coroutine functions get spawned,
it will find `pending_tokens == 0` and return immediately

instead of constructing each token inside the spawned coroutine
function, construct them outside of spawn and capture them in the lambda
to extend their lifetime until the coroutine's completion

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_notify.cc