Skip to content

p2p: trying to reconnect despite already being connected #2716

Closed
@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.

Activity

ebuchman

ebuchman commented on Oct 27, 2018

@ebuchman
ContributorAuthor

Note we tried to address this once before but looks like it was insufficient: #2327

melekes

melekes commented on Jan 17, 2019

@melekes
Contributor

I moved IsDialingOrExistingAddress check into DialPeerWithAddress here

added this to the v0.32.0 milestone on Jan 23, 2019
modified the milestones: v0.33.0, v0.31.1 on Feb 28, 2019
self-assigned this
on Apr 1, 2019
added a commit that references this issue on Apr 3, 2019
f965a4d
melekes

melekes commented on Apr 3, 2019

@melekes
Contributor

Merged #3011 to develop.

7 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    p2p: trying to reconnect despite already being connected · Issue #2716 · tendermint/tendermint