Skip to content

p2p: trying to reconnect despite already being connected #2716

@ebuchman

Description

@ebuchman

In DialPeersAsync, we check if we're already dialing the peer, but not if we're already connected to them. Then we sleep a random amount before actually dialing them.

Since the PEX doesn't know about persistent peers, it's possible for the PEX to be dialing or even to have already connected to a peer during this time. Then the DialPeersAsync will try to dial, and when it fails, it will keep trying to reconnect, even if we're already connected!

I think this might also explain #2332

I think we want to centralize dialing into a single location so that these kind of races aren't possible.

Metadata

Metadata

Assignees

Labels

C:p2pComponent: P2P pkgT:bugType Bug (Confirmed)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions