* [ruby-core:120787] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
@ 2025-01-24 18:12 dmlary (David Lary) via ruby-core
2025-01-25 4:53 ` [ruby-core:120789] " alanwu (Alan Wu) via ruby-core
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: dmlary (David Lary) via ruby-core @ 2025-01-24 18:12 UTC (permalink / raw)
To: ruby-core; +Cc: dmlary (David Lary)
Issue #21088 has been reported by dmlary (David Lary).
----------------------------------------
Bug #21088: TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
https://bugs.ruby-lang.org/issues/21088
* Author: dmlary (David Lary)
* Status: Open
* ruby -v: 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
`TCPSocket.new` raises `Socket::ResolutionError` when the connection is refused for hosts defined in /etc/hosts. It should raise `Errno::ECONNREFUSED`.
```ruby
[6] pry(main)> TCPSocket.new("test_system", 22)
=> #<TCPSocket:fd 8, AF_INET, 10.1.1.1, 51690>
[7] pry(main)> TCPSocket.new("test_system", 12345)
Socket::ResolutionError: getaddrinfo(3): No address associated with hostname (Socket::ResolutionError)
[14] pry(main)> ::Socket.getaddrinfo("test_system", nil)
=> [["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 1 (0x1), 6 (0x6)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 2 (0x2), 17 (0x11)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 3 (0x3), 0]]
```
I've confirmed with tcpdump that the local system is sending the SYN to the remote host, and it is getting RST back.
This was not a problem in 3.3.0.
This does not happen when using `localhost`
This does not happen for hosts resolvable via DNS.
This is not the same as #20172 as this is a consistent failure and the fix for that was merged almost a year ago.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:120789] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
2025-01-24 18:12 [ruby-core:120787] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts dmlary (David Lary) via ruby-core
@ 2025-01-25 4:53 ` alanwu (Alan Wu) via ruby-core
2025-01-28 17:03 ` [ruby-core:120809] " dmlary (David Lary) via ruby-core
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: alanwu (Alan Wu) via ruby-core @ 2025-01-25 4:53 UTC (permalink / raw)
To: ruby-core; +Cc: alanwu (Alan Wu)
Issue #21088 has been updated by alanwu (Alan Wu).
This might be related to HEv2(#20108). Try testing with `Socket.tcp_fast_fallback = false`.
----------------------------------------
Bug #21088: TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
https://bugs.ruby-lang.org/issues/21088#change-111657
* Author: dmlary (David Lary)
* Status: Open
* ruby -v: 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
`TCPSocket.new` raises `Socket::ResolutionError` when the connection is refused for hosts defined in /etc/hosts. It should raise `Errno::ECONNREFUSED`.
```ruby
[6] pry(main)> TCPSocket.new("test_system", 22)
=> #<TCPSocket:fd 8, AF_INET, 10.1.1.1, 51690>
[7] pry(main)> TCPSocket.new("test_system", 12345)
Socket::ResolutionError: getaddrinfo(3): No address associated with hostname (Socket::ResolutionError)
[14] pry(main)> ::Socket.getaddrinfo("test_system", nil)
=> [["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 1 (0x1), 6 (0x6)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 2 (0x2), 17 (0x11)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 3 (0x3), 0]]
```
I've confirmed with tcpdump that the local system is sending the SYN to the remote host, and it is getting RST back.
This was not a problem in 3.3.0.
This does not happen when using `localhost`
This does not happen for hosts resolvable via DNS.
This is not the same as #20172 as this is a consistent failure and the fix for that was merged almost a year ago.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:120809] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
2025-01-24 18:12 [ruby-core:120787] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts dmlary (David Lary) via ruby-core
2025-01-25 4:53 ` [ruby-core:120789] " alanwu (Alan Wu) via ruby-core
@ 2025-01-28 17:03 ` dmlary (David Lary) via ruby-core
2025-01-29 11:24 ` [ruby-core:120824] " midnight (Sarun R) via ruby-core
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: dmlary (David Lary) via ruby-core @ 2025-01-28 17:03 UTC (permalink / raw)
To: ruby-core; +Cc: dmlary (David Lary)
Issue #21088 has been updated by dmlary (David Lary).
Setting `Socket.tcp_fast_fallback = false` does fix the issue. I get `Errno::ECONNREFUSED` in that case.
```
[1] pry(main)> require "socket"
=> true
[2] pry(main)> TCPSocket.new("test_system", 12345)
Socket::ResolutionError: getaddrinfo(3): No address associated with hostname (Socket::ResolutionError)
from (pry):2:in 'TCPSocket#initialize'
[3] pry(main)> Socket.tcp_fast_fallback = false
=> false
[4] pry(main)> TCPSocket.new("test_system", 12345)
Errno::ECONNREFUSED: Connection refused - connect(2) for "isr4" port 12345 (Errno::ECONNREFUSED)
from (pry):4:in 'TCPSocket#initialize'
```
----------------------------------------
Bug #21088: TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
https://bugs.ruby-lang.org/issues/21088#change-111677
* Author: dmlary (David Lary)
* Status: Open
* ruby -v: 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
`TCPSocket.new` raises `Socket::ResolutionError` when the connection is refused for hosts defined in /etc/hosts. It should raise `Errno::ECONNREFUSED`.
```ruby
[6] pry(main)> TCPSocket.new("test_system", 22)
=> #<TCPSocket:fd 8, AF_INET, 10.1.1.1, 51690>
[7] pry(main)> TCPSocket.new("test_system", 12345)
Socket::ResolutionError: getaddrinfo(3): No address associated with hostname (Socket::ResolutionError)
[14] pry(main)> ::Socket.getaddrinfo("test_system", nil)
=> [["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 1 (0x1), 6 (0x6)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 2 (0x2), 17 (0x11)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 3 (0x3), 0]]
```
I've confirmed with tcpdump that the local system is sending the SYN to the remote host, and it is getting RST back.
This was not a problem in 3.3.0.
This does not happen when using `localhost`
This does not happen for hosts resolvable via DNS.
This is not the same as #20172 as this is a consistent failure and the fix for that was merged almost a year ago.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:120824] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
2025-01-24 18:12 [ruby-core:120787] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts dmlary (David Lary) via ruby-core
2025-01-25 4:53 ` [ruby-core:120789] " alanwu (Alan Wu) via ruby-core
2025-01-28 17:03 ` [ruby-core:120809] " dmlary (David Lary) via ruby-core
@ 2025-01-29 11:24 ` midnight (Sarun R) via ruby-core
2025-01-29 13:29 ` [ruby-core:120827] " shioimm (Misaki Shioi) via ruby-core
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: midnight (Sarun R) via ruby-core @ 2025-01-29 11:24 UTC (permalink / raw)
To: ruby-core; +Cc: midnight (Sarun R)
Issue #21088 has been updated by midnight (Sarun R).
This feature was merged a few months ago (#20782) by @shioimm,
with a [non-trivial state machine implementation](https://gist.github.com/shioimm/fbb09f103caf0812137c5c67ffa14eb6).
I'm pretty sure this is a missing edge case.
----------------------------------------
Bug #21088: TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
https://bugs.ruby-lang.org/issues/21088#change-111691
* Author: dmlary (David Lary)
* Status: Open
* ruby -v: 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
`TCPSocket.new` raises `Socket::ResolutionError` when the connection is refused for hosts defined in /etc/hosts. It should raise `Errno::ECONNREFUSED`.
```ruby
[6] pry(main)> TCPSocket.new("test_system", 22)
=> #<TCPSocket:fd 8, AF_INET, 10.1.1.1, 51690>
[7] pry(main)> TCPSocket.new("test_system", 12345)
Socket::ResolutionError: getaddrinfo(3): No address associated with hostname (Socket::ResolutionError)
[14] pry(main)> ::Socket.getaddrinfo("test_system", nil)
=> [["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 1 (0x1), 6 (0x6)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 2 (0x2), 17 (0x11)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 3 (0x3), 0]]
```
I've confirmed with tcpdump that the local system is sending the SYN to the remote host, and it is getting RST back.
This was not a problem in 3.3.0.
This does not happen when using `localhost`
This does not happen for hosts resolvable via DNS.
This is not the same as #20172 as this is a consistent failure and the fix for that was merged almost a year ago.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:120827] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
2025-01-24 18:12 [ruby-core:120787] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts dmlary (David Lary) via ruby-core
` (2 preceding siblings ...)
2025-01-29 11:24 ` [ruby-core:120824] " midnight (Sarun R) via ruby-core
@ 2025-01-29 13:29 ` shioimm (Misaki Shioi) via ruby-core
2025-01-30 1:25 ` [ruby-core:120837] " hsbt (Hiroshi SHIBATA) via ruby-core
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: shioimm (Misaki Shioi) via ruby-core @ 2025-01-29 13:29 UTC (permalink / raw)
To: ruby-core; +Cc: shioimm (Misaki Shioi)
Issue #21088 has been updated by shioimm (Misaki Shioi).
Thank you for reporting.
I am aware of this issue and am working on resolving it.
----------------------------------------
Bug #21088: TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
https://bugs.ruby-lang.org/issues/21088#change-111694
* Author: dmlary (David Lary)
* Status: Open
* ruby -v: 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
`TCPSocket.new` raises `Socket::ResolutionError` when the connection is refused for hosts defined in /etc/hosts. It should raise `Errno::ECONNREFUSED`.
```ruby
[6] pry(main)> TCPSocket.new("test_system", 22)
=> #<TCPSocket:fd 8, AF_INET, 10.1.1.1, 51690>
[7] pry(main)> TCPSocket.new("test_system", 12345)
Socket::ResolutionError: getaddrinfo(3): No address associated with hostname (Socket::ResolutionError)
[14] pry(main)> ::Socket.getaddrinfo("test_system", nil)
=> [["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 1 (0x1), 6 (0x6)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 2 (0x2), 17 (0x11)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 3 (0x3), 0]]
```
I've confirmed with tcpdump that the local system is sending the SYN to the remote host, and it is getting RST back.
This was not a problem in 3.3.0.
This does not happen when using `localhost`
This does not happen for hosts resolvable via DNS.
This is not the same as #20172 as this is a consistent failure and the fix for that was merged almost a year ago.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:120837] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
2025-01-24 18:12 [ruby-core:120787] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts dmlary (David Lary) via ruby-core
` (3 preceding siblings ...)
2025-01-29 13:29 ` [ruby-core:120827] " shioimm (Misaki Shioi) via ruby-core
@ 2025-01-30 1:25 ` hsbt (Hiroshi SHIBATA) via ruby-core
2025-02-04 4:20 ` [ruby-core:120874] " shioimm (Misaki Shioi) via ruby-core
2025-02-04 5:50 ` [ruby-core:120875] " nagachika (Tomoyuki Chikanaga) via ruby-core
6 siblings, 0 replies; 8+ messages in thread
From: hsbt (Hiroshi SHIBATA) via ruby-core @ 2025-01-30 1:25 UTC (permalink / raw)
To: ruby-core; +Cc: hsbt (Hiroshi SHIBATA)
Issue #21088 has been updated by hsbt (Hiroshi SHIBATA).
Status changed from Open to Assigned
Assignee set to shioimm (Misaki Shioi)
----------------------------------------
Bug #21088: TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
https://bugs.ruby-lang.org/issues/21088#change-111702
* Author: dmlary (David Lary)
* Status: Assigned
* Assignee: shioimm (Misaki Shioi)
* ruby -v: 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
`TCPSocket.new` raises `Socket::ResolutionError` when the connection is refused for hosts defined in /etc/hosts. It should raise `Errno::ECONNREFUSED`.
```ruby
[6] pry(main)> TCPSocket.new("test_system", 22)
=> #<TCPSocket:fd 8, AF_INET, 10.1.1.1, 51690>
[7] pry(main)> TCPSocket.new("test_system", 12345)
Socket::ResolutionError: getaddrinfo(3): No address associated with hostname (Socket::ResolutionError)
[14] pry(main)> ::Socket.getaddrinfo("test_system", nil)
=> [["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 1 (0x1), 6 (0x6)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 2 (0x2), 17 (0x11)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 3 (0x3), 0]]
```
I've confirmed with tcpdump that the local system is sending the SYN to the remote host, and it is getting RST back.
This was not a problem in 3.3.0.
This does not happen when using `localhost`
This does not happen for hosts resolvable via DNS.
This is not the same as #20172 as this is a consistent failure and the fix for that was merged almost a year ago.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:120874] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
2025-01-24 18:12 [ruby-core:120787] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts dmlary (David Lary) via ruby-core
` (4 preceding siblings ...)
2025-01-30 1:25 ` [ruby-core:120837] " hsbt (Hiroshi SHIBATA) via ruby-core
@ 2025-02-04 4:20 ` shioimm (Misaki Shioi) via ruby-core
2025-02-04 5:50 ` [ruby-core:120875] " nagachika (Tomoyuki Chikanaga) via ruby-core
6 siblings, 0 replies; 8+ messages in thread
From: shioimm (Misaki Shioi) via ruby-core @ 2025-02-04 4:20 UTC (permalink / raw)
To: ruby-core; +Cc: shioimm (Misaki Shioi)
Issue #21088 has been updated by shioimm (Misaki Shioi).
Status changed from Assigned to Closed
@dmlary
Unfortunately, I was unable to reproduce the issue you reported. However, I believe I have fixed the code that was likely causing the problem in this change.
https://github.com/ruby/ruby/pull/12678
It should be resolved in the next Ruby version.
If the issue still occurs, please let me know. Thank you very much for your report.
----------------------------------------
Bug #21088: TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
https://bugs.ruby-lang.org/issues/21088#change-111749
* Author: dmlary (David Lary)
* Status: Closed
* Assignee: shioimm (Misaki Shioi)
* ruby -v: 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
`TCPSocket.new` raises `Socket::ResolutionError` when the connection is refused for hosts defined in /etc/hosts. It should raise `Errno::ECONNREFUSED`.
```ruby
[6] pry(main)> TCPSocket.new("test_system", 22)
=> #<TCPSocket:fd 8, AF_INET, 10.1.1.1, 51690>
[7] pry(main)> TCPSocket.new("test_system", 12345)
Socket::ResolutionError: getaddrinfo(3): No address associated with hostname (Socket::ResolutionError)
[14] pry(main)> ::Socket.getaddrinfo("test_system", nil)
=> [["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 1 (0x1), 6 (0x6)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 2 (0x2), 17 (0x11)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 3 (0x3), 0]]
```
I've confirmed with tcpdump that the local system is sending the SYN to the remote host, and it is getting RST back.
This was not a problem in 3.3.0.
This does not happen when using `localhost`
This does not happen for hosts resolvable via DNS.
This is not the same as #20172 as this is a consistent failure and the fix for that was merged almost a year ago.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:120875] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
2025-01-24 18:12 [ruby-core:120787] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts dmlary (David Lary) via ruby-core
` (5 preceding siblings ...)
2025-02-04 4:20 ` [ruby-core:120874] " shioimm (Misaki Shioi) via ruby-core
@ 2025-02-04 5:50 ` nagachika (Tomoyuki Chikanaga) via ruby-core
6 siblings, 0 replies; 8+ messages in thread
From: nagachika (Tomoyuki Chikanaga) via ruby-core @ 2025-02-04 5:50 UTC (permalink / raw)
To: ruby-core; +Cc: nagachika (Tomoyuki Chikanaga)
Issue #21088 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED
I think the changeset is worth to backport to ruby_3_4.
----------------------------------------
Bug #21088: TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts
https://bugs.ruby-lang.org/issues/21088#change-111750
* Author: dmlary (David Lary)
* Status: Closed
* Assignee: shioimm (Misaki Shioi)
* ruby -v: 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
* Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED
----------------------------------------
`TCPSocket.new` raises `Socket::ResolutionError` when the connection is refused for hosts defined in /etc/hosts. It should raise `Errno::ECONNREFUSED`.
```ruby
[6] pry(main)> TCPSocket.new("test_system", 22)
=> #<TCPSocket:fd 8, AF_INET, 10.1.1.1, 51690>
[7] pry(main)> TCPSocket.new("test_system", 12345)
Socket::ResolutionError: getaddrinfo(3): No address associated with hostname (Socket::ResolutionError)
[14] pry(main)> ::Socket.getaddrinfo("test_system", nil)
=> [["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 1 (0x1), 6 (0x6)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 2 (0x2), 17 (0x11)],
["AF_INET", 0, "10.1.1.204", "10.1.1.204", 2 (0x2), 3 (0x3), 0]]
```
I've confirmed with tcpdump that the local system is sending the SYN to the remote host, and it is getting RST back.
This was not a problem in 3.3.0.
This does not happen when using `localhost`
This does not happen for hosts resolvable via DNS.
This is not the same as #20172 as this is a consistent failure and the fix for that was merged almost a year ago.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-02-04 5:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-24 18:12 [ruby-core:120787] [Ruby master Bug#21088] TCPSocket.new raises Socket::ResolutionError instead of Errno::ECONNREFUSED for hosts defined in /etc/hosts dmlary (David Lary) via ruby-core
2025-01-25 4:53 ` [ruby-core:120789] " alanwu (Alan Wu) via ruby-core
2025-01-28 17:03 ` [ruby-core:120809] " dmlary (David Lary) via ruby-core
2025-01-29 11:24 ` [ruby-core:120824] " midnight (Sarun R) via ruby-core
2025-01-29 13:29 ` [ruby-core:120827] " shioimm (Misaki Shioi) via ruby-core
2025-01-30 1:25 ` [ruby-core:120837] " hsbt (Hiroshi SHIBATA) via ruby-core
2025-02-04 4:20 ` [ruby-core:120874] " shioimm (Misaki Shioi) via ruby-core
2025-02-04 5:50 ` [ruby-core:120875] " nagachika (Tomoyuki Chikanaga) via ruby-core
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).