-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
We also need to figure out a mechanism to pass down context options to the transport where applicable. |
For instance, in libp2p/go-libp2p-quic-transport#194 we do make use of the |
That will depend on the option. The simplest is to just let the first to dial win. That should work for the "active listen" case and is probably our best option. Unfortunately, that doesn't work so well for the direct connection case because the two different dials have two different requirements. |
808a8e5
to
ddfb5b3
Compare
Given two relay connections, prefer the one that's non-transient. Otherwise, a transient connection could prevent us from opening streams even if we have a second non-transient connection through a better relay.
Otherwise, canceling one dial request will cancel all "joined" dial requests.
ddfb5b3
to
14d544b
Compare
makes TestDialBackoff happy
i want to use binary literals; technically only requires 1.13, but let's not be ancient
for consistency with the old dialer behaviour.
we might get more connections because simultaneous dials can succeed and we have both TCP and QUIC addrs by default
… a dial backoff occurs
so that we exercise the dialWorker dial to self error path
they work with private data types, so there is no point in having them public
Fix simultaneous dials
The test failure was the flaky connection gating test; see #251. |
The direct connection rework introduced two bugs in the dialer and exposed a variety of issues.
2 is actually pretty common. If I try to make two requests to a peer a the same time, then decide to cancel the first, the second request will get canceled.
Requirements to fix the situation:
We need a test for both of these cases.We need a test for the first case. We had a test for the second case and ignored failing CI.A better implementation of 2 is to have new dials "join" an active dial by sending an address filter function to the active dial over a channel. The channel would then:
This is my preferred approach.
We could also consider approaches where:
But given that we now have multiple people working on this project, I'd much prefer to go with the correct approach.
The new dialer was implemented in #250 .