Closed
Description
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.
Activity
ebuchman commentedon Oct 27, 2018
Note we tried to address this once before but looks like it was insufficient: #2327
melekes commentedon Jan 17, 2019
I moved IsDialingOrExistingAddress check into DialPeerWithAddress here
p2p: seed mode refactoring (#3011)
melekes commentedon Apr 3, 2019
Merged #3011 to develop.
7 remaining items