-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grpc: AsyncTaskExecutor and basic server lifecycle #11984
Open
vishesh
wants to merge
2
commits into
apple:main
Choose a base branch
from
vishesh:grpc-sim
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+605
−207
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This patch implements `AsyncTaskExecutor` for asynchronous execution of tasks in a separate thread pool. We already have `IThreadPool` however its API is more well suited for bigger tasks. This just provides an easier to use API. There is `AsyncTaskThread` which is similar in nature, but this is not re-wrapping IThreadPool hence has ability to have multiple worker threads. We can potentially replace that with this component by setting `num_threads = 1`. TODO: Move this to `flow/include` instead of here.
Result of foundationdb-pr-clang on Linux CentOS 7
|
Result of foundationdb-pr on Linux CentOS 7
|
Result of foundationdb-pr-clang-ide on Linux CentOS 7
|
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
This patch has two set of changes: - Whenever a service is registered and removed from server, we need to restart gRPC server. GrpcServer provides some methods that can be used by worker actors so that the life of services registered by them can tied to the life of the worker role itself. - Replace asio::thread_pool with AsyncTaskExecutor both in client and server.
Result of foundationdb-pr-clang-ide on Linux CentOS 7
|
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Result of foundationdb-pr-clang on Linux CentOS 7
|
Result of foundationdb-pr on Linux CentOS 7
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR has three changes:
asio::post
orstd::async
. There isAsyncTaskThread
in fdbclient which serves similar purpose, however it doesn't useIThreadPool
hence doesn't set the simulation thread_locals correcly, and also just uses one thread. That should be equivalent of setting num_thread = 1 in this class.asio::thread_pool
.Testing:
Some correctness issues around RockDB. Debugging, but some were unrelated to this. e.g. #11981
Has some basic unit-tests and will keep adding more in subsequent PRs where I'm actually making use of these.
Code-Reviewer Section
The general pull request guidelines can be found here.
Please check each of the following things and check all boxes before accepting a PR.
For Release-Branches
If this PR is made against a release-branch, please also check the following:
release-branch
ormain
if this is the youngest branch)