Open Capncavedan opened 9 months ago
I don't like this approach, too brittle, but maybe somebody has a smarter approach to deciding "is Socksify going to cause a problem"?
Updated conditions used within this method
def self.create_socket_with_timeout(host, port, options)
new_takes_kwargs = true if RUBY_VERSION >= '3.0' &&
!::TCPSocket.private_instance_methods.include?(:original_resolv_initialize)
new_takes_kwargs = false if defined?(Socksify)
if new_takes_kwargs
sock = new(host, port, connect_timeout: options[:socket_timeout])
yield(sock)
else
Timeout.timeout(options[:socket_timeout]) do
sock = new(host, port)
yield(sock)
end
end
end
i face the same issue with: Dalli 3.2.8 Ruby version 3.1.4
I've opened #998 to add tests to check compatibility with other gems without depending on them, and #999 to adjust the approach from #989 to handle compatibility with both resolv-replace
and socksify
.
Chiming in to just to say we're also facing this issue and it's blocking us from upgrading to the latest Dalli version. The approach in #999 looks good to me.
Dalli 3.2.7 and 3.2.8 cause a TypeError in Socksify. 3.2.6 works OK.
Ruby version 3.0.6.
Reproduction script, passes with socksify 1.7.1 and dalli 3.2.6 installed, fails with dalli from 3.2.7.
Backtrace: