Skip to content
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

[5.0] PH: Post on resolver strand to ensure execution on strand #1863

Closed
wants to merge 1 commit into from

Conversation

heifner
Copy link
Member

@heifner heifner commented Nov 6, 2023

Unable to get anything meaningful from the core dumps of the failed test of #1858. Before this change the async_resolve would run on the main thread even though the resolver was given a different thread to execute on. This change makes sure the resolver is only touched by the resolver thread.

Resolves #1858

@heifner heifner linked an issue Nov 6, 2023 that may be closed by this pull request
@heifner heifner requested review from linh2931 and greg7mdp November 6, 2023 13:49
@heifner heifner added the OCI Work exclusive to OCI team label Nov 6, 2023
@greg7mdp
Copy link
Contributor

greg7mdp commented Nov 6, 2023

I don't see the benefit of using a different strand for resolver_ and stream_?

@heifner
Copy link
Member Author

heifner commented Nov 6, 2023

I don't see the benefit of using a different strand for resolver_ and stream_?

No benefit I see either. I'll fix it.

Comment on lines +83 to +86
boost::asio::post( resolver_.get_executor(), [host, port, self=this->shared_from_this()] {
self->resolver_.async_resolve(
host, std::to_string(port), [self](beast::error_code ec, auto res) { self->on_resolve(ec, res); });
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change make a difference? I would have thought that, since we provide an executor when building the resolver, the async functions would already be posted on this executor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code follows the example of libs/beast/example/http/client/async/http_client_async.cpp however I think it would be better to follow https://www.boost.org/doc/libs/1_83_0/libs/beast/example/http/client/crawl/http_crawl.cpp as that is a multi-threaded example. I'll close this PR and create a new one with those changes.

@heifner heifner closed this Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

performance_test_basic_read_only_trxs failure
2 participants