diff options
author | Jean Boussier <[email protected]> | 2025-03-10 21:18:59 +0100 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-03-10 22:57:44 +0100 |
commit | ba5fb74583303d9e80f3700d0b5433cbc7e7c88e (patch) | |
tree | 5f10c8161b2fab5b0f5f373035cf8eb79713ccdb /ext/socket | |
parent | e418ba0928ab96ac645ab42d77af34806d74c20e (diff) |
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'
```
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12896
Diffstat (limited to 'ext/socket')
-rw-r--r-- | ext/socket/lib/socket.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb index 4ebc437a99..ae73b8799e 100644 --- a/ext/socket/lib/socket.rb +++ b/ext/socket/lib/socket.rb @@ -1021,8 +1021,8 @@ class Socket < BasicSocket private_constant :HostnameResolutionResult class HostnameResolutionStore - PRIORITY_ON_V6 = [:ipv6, :ipv4] - PRIORITY_ON_V4 = [:ipv4, :ipv6] + PRIORITY_ON_V6 = [:ipv6, :ipv4].freeze + PRIORITY_ON_V4 = [:ipv4, :ipv6].freeze def initialize(family_names) @family_names = family_names |