]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/async: remove error_codes from co_throttle interface
authorCasey Bodley <cbodley@redhat.com>
Mon, 6 Feb 2023 22:05:12 +0000 (17:05 -0500)
committerAdam Emerson <aemerson@redhat.com>
Thu, 14 Sep 2023 21:48:00 +0000 (17:48 -0400)
commit6b84b7bcc3531a8aebfe164a4e0847b68c76f791
tree546f8889c0cfab6b79b30652bf1771804790550a
parentd72e2e4a8bf896ef1b0ab38d4e5ac153f3ca54c1
common/async: remove error_codes from co_throttle interface

in the initial design of co_throttle described in
https://github.com/ceph/ceph/pull/49720, the cancel_on_error option only
applied to errors from awaitable<error_code> but not to exceptions from
awaitable<void> coroutines

with the decision to use exceptions as the default method of error
handling in rgw multisite, this design choice no longer makes sense.
i've removed the error_code overloads entirely, and changed the
exception handling logic to match the previous behavior for error codes

the unit tests were rewritten with co_waiter instead of timers to make
them deterministic and faster. co_waiter's cancellation behavior
exposed some issues where the cancellation signal could cause the
completions to recurse, so on_complete() was restructured to tolerate
that

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/async/co_throttle.h
src/common/async/detail/co_throttle_impl.h
src/test/common/test_async_co_throttle.cc