Repository navigation
Implement RFC 8305, the "Happy Eyeballs". - #793
Closed
midnight-wonderer wants to merge 1 commit into
Closed
midnight-wonderer wants to merge 1 commit into
midnight-wonderer wants to merge 1 commit into
Conversation
Contributor
Author
|
Landed on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This addresses #739.
Happy Eyeballs landed in Ruby for quite some time. 🎉
https://bugs.ruby-lang.org/issues/20108
However, it does not reach HTTP.rb yet.
This is because HTTP.rb uses TCPSocket.open by default.
Source traces
openwas implemented in the IO class as an alias tonew.https://github.com/ruby/ruby/blob/37a16c7812f5b7e6faa762b927e9f04065cc495a/io.c#L8124
TCPSocket, it is bound directly to the c source code.https://github.com/ruby/ruby/blob/6deeec5d459ecff5ec4628523b14ac7379fd942e/ext/socket/tcpsocket.c#L54
ruby/ruby@9ec342e
A baby step
In order to take advantage of the new feature. I alias
default_socket_classtoSocket.tcpso the connection logic will be handled by the Ruby layer ofSocket.Rough edges
For your information
Socket.tcphas a lot of features beyond Happy Eyeballs.For example, it supports
connect_timeoutnatively.What to do with
http/lib/http/timeout/global.rb
Line 24 in db6863a
This is just one aspect of it.
Nevertheless, this baby step would introduce minimal breaking changes. (or any changes at all)
Providing more robust connections.