Internal node io context#4618
Merged
pwojcikdev merged 15 commits intonanocurrency:developfrom May 14, 2024
Merged
Conversation
pwojcikdev
commented
May 13, 2024
| @@ -139,13 +140,15 @@ nano::node::node (std::shared_ptr<boost::asio::io_context> io_ctx_a, uint16_t pe | |||
| } | |||
|
|
|||
| nano::node::node (std::shared_ptr<boost::asio::io_context> io_ctx_a, std::filesystem::path const & application_path_a, nano::node_config const & config_a, nano::work_pool & work_a, nano::node_flags flags_a, unsigned seq) : | |||
Contributor
Author
There was a problem hiding this comment.
A reference to io_ctx is still passed, unnecessarily. Removing it now would add noise. Such cleanup can be easily done in a subsequent PR.
clemahieu
approved these changes
May 13, 2024
Contributor
clemahieu
left a comment
There was a problem hiding this comment.
Comments are just observations. This fixes a locally consistently failing test socket.max_connections.
Even though some parts are rough around the edges, ipc_service::stop, I'd much rather get this change in as it's been attempted many times and never finished.
This file contains hidden or 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
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.
Currently all nodes, rpc and ipc servers share common IO context. This PR changes it, so that each node owns and runs its own io_context. This ensures that any io operations scheduled to run using that executor can't outlive the node itself. This greatly simplifies system design.
It's likely that this will uncover many race conditions in tests. The most obvious ones should already be fixed, but please keep in mind that if a test starts failing after this PR, it likely wasn't fully correct to start with.