Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2403] Periodically connect to peers from table #1170

Merged
merged 10 commits into from
Mar 26, 2019

Conversation

mbaxter
Copy link
Contributor

@mbaxter mbaxter commented Mar 26, 2019

PR description

This PR builds on #903. The periodic connection logic has been updated to be more aggressive and tests have been added. Additionally, executor logic has been moved from NetworkRunner into NettyP2PNetwork allowing the P2PNetwork interface to be simplified.

@mbaxter mbaxter requested review from ajsutton and shemnon March 26, 2019 19:25
.filter(peer -> peer.getStatus() == PeerDiscoveryStatus.BONDED)
.filter(peer -> !isConnected(peer) && !isConnecting(peer))
.collect(Collectors.toList());
Collections.shuffle(peers);
Copy link
Contributor

Choose a reason for hiding this comment

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

Paranoia: should we use Collections.shuffle(List<?>, Random) with a secure random?

return controller
.map(PeerDiscoveryController::getPeers)
.map(Collections::unmodifiableCollection)
.orElse(Collections.emptyList());
Copy link
Contributor

Choose a reason for hiding this comment

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

Eliminating temporary collections. Nice!

@mbaxter mbaxter merged commit 2cb58cd into PegaSysEng:master Mar 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants