In the standard Ruby library since 3.0.0 the signature for the TCPSocket initializer is
TCPSocket.new(remote_host, remote_port, local_host=nil, local_port=nil, connect_timeout: nil) link
I should be able to call the initializer with a remote_host, a remote_port, and a connect_timeout entry, like so:
TCPSocket.new('host.example.com', 1234, connect_timeout: 1000)
This works against the standard library, but fails when resolv-replace is in place, because the connect_timeout keyword argument is not properly handled. Instead, the connect_timeout argument is treated as a hash { connect_timeout: 1000 } as there's an error when this is used as the local_host value.
As linked below, this is causing an issue for some users of Dalli.