Description: Drop memoization of connect_timeout support check
 The supports_connect_timeout? method was memoized at class level, so it only
 checked TCPSocket#initialize parameters once. When socksify or resolv-replace
 override TCPSocket#initialize without supporting **kwargs, the memoized true
 value causes Dalli to pass {connect_timeout: sec} as a positional Hash
 instead of using the fallback Timeout.timeout block, leading to TypeError: no
 implicit conversion of Hash into String during socket creation.
Author: Simon Quigley <tsimonq2@debian.org>
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-02-26
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/lib/dalli/socket.rb
+++ b/lib/dalli/socket.rb
@@ -126,8 +126,6 @@ module Dalli
       # Returns false when monkey-patched by gems like socksify or resolv-replace < 0.2.0.
       # rubocop:disable ThreadSafety/ClassInstanceVariable
       def self.supports_connect_timeout?
-        return @supports_connect_timeout if defined?(@supports_connect_timeout)
-
         @supports_connect_timeout = RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '3.0' &&
                                     ::TCPSocket.instance_method(:initialize).parameters.then do |params|
                                       params == TCPSOCKET_NATIVE_PARAMETERS || params.any? do |type, _|
--- a/test/test_socket.rb
+++ b/test/test_socket.rb
@@ -32,6 +32,7 @@ describe 'Dalli::Socket::TCP' do
     end
 
     it 'caches the result' do
+      skip
       # First call
       result1 = Dalli::Socket::TCP.supports_connect_timeout?
 
