The Less-Told Story of Socket Timeouts

TCPSocket.new and Socket.tcp are methods that return a socket connected to a remote host over TCP, and starting with Ruby 4.0, they introduce a new timeout feature called open_timeout.
Even before Ruby 3.4, these methods already provided two kinds of timeout features: resolv_timeout, which sets a timeout for hostname resolution, and connect_timeout, which sets a timeout for establishing the connection.

Why, then, is a third timeout necessary now? The answer lies in a less-told story of these methods.

In this talk, I would like to discuss the history of how these methods came to have the timeout features, the impact of the HEv2 algorithm introduced in Ruby 3.4, the bug that had actually existed for a long time, and the new feature that comprehensively improves these methods for the future, along with concrete implementation details.