-
Notifications
You must be signed in to change notification settings - Fork 49
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
Track pending outgoing connections to peers #398
Comments
So you're suggesting to ignore nodes which their pubkey is already listed on |
Exactly. |
Sounds good to me. If we'll want to support parallelism (specially due to connection retries, which can take ages), we'll need to introduce |
Yup. Maybe we introduce parallelism later, for now though I think this approach would be a significant improvement. |
Introducing If yes, that's what we need! |
Yeah, well we already have checks in place to not attempt a connection to a peer we're already connected to. This will check to make sure we're not attempting a connection a peer we're already attempting to connect to. |
Ok thx. As per #392 (comment) I suggest |
I think just nodepubkey would be enough actually, since all outgoing connections reference a peer nodepubkey, we just check if we have a pending peer for the given nodepubkey. |
If we do #392 the serial way yes, if we do retries in parallel we would need |
Yeah that's true. But I'm pretty sure I prefer the serial approach, otherwise I think we'd see this same burst of failing connection attempts should anyone have a lot of listening addresses configured. |
I'll take this issue |
That would be great, I haven't started any work on it yet. Let me know if you have any questions at all. |
Right now, on startup it's common to get a flood of
NODES
packets all at once which have a lot of overlap, which then results in multiple outgoing connection attempts to those nodes. There's no mechanism currently to check if we're attempting to connect to a given node. For this issue I suggest that we track apendingPeers
Map in Pool which maps peer's node pub keys to the unopenedPeer
object. When the peer connection either succeeds and the open event is fired, or fails and the close event is fired, we remove the peer frompendingPeers
and add topeers
if successful.The text was updated successfully, but these errors were encountered: