-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Happy Eyeballs for TCP #2394
Comments
Thank you for opening an issue on this @sukunrt! What about changing the Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) (CapableConn, error) to Dial(ctx context.Context, raddr ma.Multiaddr, p peer.ID) chan DialResult
type DialResult struct {
Kind DialResultKind // an enum with DialFailed, DialSucceeded and DialProgressed
Error error
Connection CapableConn
}
This is a pretty big change in our |
I like your suggestion.
This variant has the problem that if the user provides a channel with low capacity it'll block the security upgrade. So it's better to let transport return a channel. |
Summarising discussions with @marten-seemann on this There are two approaches we can take to allow for updates
Both of them need an extra goroutine per Dial to handle returned values from the Transport. This is because we do checks on the returned value here As an alternative we can do
where we are only notified of I propose we do
And move all post processing which requires a separate go routine outside of
The best we can do is document this requirement. |
We currently do not do any prioritisation among TCP addresses when dialing. This is because TCP connection establishment takes too long(3*RTT) and the delay required between dials for effective prioritisation would be roughly 750ms - 1s. This delay is too high in case we fail to establish a connection with the first tcp address we try.
We can get around this if we setup a system where the worker loop is notified when a TCP connection is established and security negotiation is in progress.
The text was updated successfully, but these errors were encountered: