Skip to content

Commit 0e416fa

Browse files
byrootk0kubun
authored andcommitted
Fix Socket.tcp_with_fast_fallback to be usable from a Ractor
[Bug #21179] ``` socket.rb:1046:in 'Socket::HostnameResolutionStore#get_addrinfo': can not access non-shareable objects in constant Socket::HostnameResolutionStore::PRIORITY_ON_V6 by non-main ractor. (Ractor::IsolationError) from socket.rb:724:in 'block in Socket.tcp_with_fast_fallback' from socket.rb:720:in 'Socket.tcp_with_fast_fallback' ```
1 parent 762e76c commit 0e416fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/socket/lib/socket.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,8 +1021,8 @@ def close
10211021
private_constant :HostnameResolutionResult
10221022

10231023
class HostnameResolutionStore
1024-
PRIORITY_ON_V6 = [:ipv6, :ipv4]
1025-
PRIORITY_ON_V4 = [:ipv4, :ipv6]
1024+
PRIORITY_ON_V6 = [:ipv6, :ipv4].freeze
1025+
PRIORITY_ON_V4 = [:ipv4, :ipv6].freeze
10261026

10271027
def initialize(family_names)
10281028
@family_names = family_names

0 commit comments

Comments
 (0)