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

Don't drop connections when simultaneous dialing occurs #174

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

aschmahmann
Copy link
Contributor

Only cancel dials when an outbound connection succeeds. This may result in duplicate connections, but it's better to have two connections than dropping both of them and ending up with zero connections.

This is not the long-term solution to this issue since we'd rather not be able to accidentally end up with two connections, but for now this should do the job.

…lt in duplicate connections, but it's better to have two connections than dropping both of them and ending up with zero connections.
@aschmahmann aschmahmann self-assigned this Mar 10, 2020
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

TL;DR: this happens in the public network very infrequently, but happens in tests frequently. The downsides of merging this are:

  1. We're more likely to form multiple connections. Of course, we'd previously simultaneously disconnect so we'll just have to say that multiple connections are better than no connections.
  2. Technically, DialPeer could continue to block after we have made a successful connection. Unfortunately, short-cutting that is a bit tricky as, if we did that, we'd have to somehow continue the dial off in the background with no owners (which would make it uncancelable).

TL;DR: anything we do here will be suboptimal but this is better than what we currently have.

@Stebalien Stebalien merged commit edeb603 into master Mar 10, 2020
@Stebalien Stebalien deleted the fix/simul-dial branch March 10, 2020 21:14
@Stebalien Stebalien mentioned this pull request Feb 25, 2021
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.

2 participants