Skip to content

asio: drop BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT#50064

Closed
cbodley wants to merge 37 commits intoceph:wip-coro-after-reeffrom
cbodley:wip-asio-no-ts-executors
Closed

asio: drop BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT#50064
cbodley wants to merge 37 commits intoceph:wip-coro-after-reeffrom
cbodley:wip-asio-no-ts-executors

Conversation

@cbodley
Copy link
Contributor

@cbodley cbodley commented Feb 10, 2023

note that this PR targets the wip-coro-after-reef feature branch

this BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT define was added for backward compatibility before boost 1.74:

https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/std_executors.html

this PR replaces all the stuff that depended on ts executors, and adds BOOST_ASIO_NO_TS_EXECUTORS to verify that

this also requires changes to the spawn submodule pending in cbodley/spawn#8

as future work, we can use boost 1.81's type-erased any_completion_handler to replace ceph::async::Completion

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@cbodley cbodley requested a review from adamemerson February 10, 2023 00:13
@cbodley cbodley force-pushed the wip-asio-no-ts-executors branch 4 times, most recently from 4e05e56 to e1f81cb Compare February 10, 2023 17:31
@github-actions github-actions bot added the rbd label Feb 10, 2023
@cbodley cbodley force-pushed the wip-asio-no-ts-executors branch from e1f81cb to ecb2c94 Compare February 10, 2023 19:55
@github-actions github-actions bot added the tests label Feb 10, 2023
@cbodley cbodley force-pushed the wip-asio-no-ts-executors branch from ecb2c94 to 2f13b02 Compare February 10, 2023 20:29
@cbodley
Copy link
Contributor Author

cbodley commented Feb 10, 2023

by adding the cmake commit last, i was able to verify that all of the code changes compile in both cases: with BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT, and with BOOST_ASIO_NO_TS_EXECUTORS

note that there's a clang error on wip-coro-after-reef, fixed by commit common/async: add co_waiter::op_cancellation ctor for clang from #50005

@cbodley cbodley marked this pull request as ready for review February 10, 2023 22:25
@cbodley cbodley requested review from a team as code owners February 10, 2023 22:25
@cbodley cbodley force-pushed the wip-asio-no-ts-executors branch from 2f13b02 to 3689e1b Compare February 14, 2023 16:35
@cbodley
Copy link
Contributor Author

cbodley commented Feb 14, 2023

this also requires changes to the spawn submodule pending in cbodley/spawn#8

these changes merged to ceph/spawn.git, so i added a commit to pull up the spawn submodule. i also verified that it compiles both with/without the final cmake commit

Needed to fix coroutine detection under Clang

TODO: update boost package sha1 in install-deps.sh when we have
packages uploaded

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Previously we had versions of all the calls that took an int64_t and
optional key and namespace.

This didn't really offer much benefit and doubled the maintenance
burden for changing anything.

As such just make the IOContext constructor non-explicit, and make all
its mutators return the same IOContext so people can supply them
builder-style if they want to.

Also don't wrap things in 'optional' when the underlying library
doesn't. The callers just end up having to wrap and unwrap with
value-or repeatedly.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This form of completion handling is compatible with C++20 Completions
and generally more flexible stuff.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
The lock will continue to be held over the 'dispatch' with C++20
coroutines.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Apparently in some cases we were using references to objects on the
caller stack that happen to no longer exist if the caller's stack goes
away.

C++20 Coroutines tickled this bug.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Use `min` rather than `max` when deciding how much we need to read in
`read()`.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Just as a demonstration to see how well they work and how to put
things together with them.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
In the `destroy_` functions of `CompletionImpl` we were getting the
associated allocator after moving out of the handler into the call to
`bind_and_forward`. This was triggering a crash on null-pointer access
in operations made with `co_composed`.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
adamemerson and others added 11 commits February 14, 2023 12:52
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
If our decoder function returns a tuple of multiple values, flatten it
so our signature is `void(error_code, T, U, V)` not
`void(error_code, std::tuple<T, U, V>)`.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
And return them to the client by setting the error cod and result in
the vector and returning an error from the operation as a whole.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Since they can be reported now, report them

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
@adamemerson adamemerson requested a review from a team as a code owner February 14, 2023 19:06
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
this define was added for backward compatibility before boost 1.74

https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/std_executors.html

Signed-off-by: Casey Bodley <cbodley@redhat.com>
@github-actions
Copy link

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

@cbodley
Copy link
Contributor Author

cbodley commented Mar 1, 2023

merged into #49737

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.

2 participants