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

P2P Refactor connections management #1187

Merged
merged 12 commits into from
May 22, 2023
Merged

P2P Refactor connections management #1187

merged 12 commits into from
May 22, 2023

Conversation

heifner
Copy link
Member

@heifner heifner commented May 17, 2023

Refactor connections set into a connections_manager class.
Simplify connections monitor timer implementation.
In preparation of work on #1072.

@heifner heifner added this to the Leap v5.0.0-rc1 milestone May 17, 2023
@heifner heifner requested review from greg7mdp and linh2931 May 17, 2023 12:27
@heifner heifner linked an issue May 17, 2023 that may be closed by this pull request
@heifner heifner added the OCI Work exclusive to OCI team label May 17, 2023
if( cptr != connections.end() ) {
auto cstart_it = cptr;
do {
// select the first one which is current and has lib above current and break out.
Copy link
Member

Choose a reason for hiding this comment

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

Why no indentation in this do-while body?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how that happened. Fixed.

}

void net_plugin::register_update_p2p_connection_metrics(std::function<void(net_plugin::p2p_connections_metrics)>&& fun){
my->update_p2p_connection_metrics = std::move(fun);
// called from any thread
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment here saying a lock is in another start_conn_timer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added comment

continue;
}
} else {
--num_clients; ++num_rm;
Copy link
Member

Choose a reason for hiding this comment

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

No indentation here.

@heifner heifner requested a review from linh2931 May 22, 2023 20:08
@heifner heifner merged commit 2d06cfb into main May 22, 2023
@heifner heifner deleted the GH-1072-refactor branch May 22, 2023 21:44
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.

P2P Improve sync behavior
3 participants