Project

General

Profile

Actions

Feature #17528

open

Make Addrinfo.getaddrinfo fall back to Timeout.timeout for :resolv_timeout

Added by mohamedhafez (Mohamed Hafez) over 3 years ago. Updated over 3 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:102005]

Description

Currently, Addrinfo.getaddrinfo ignores the :resolv_timeout option if we are on a system without getaddrinfo_a. It would be great if instead it would fall back to using Timeout.timeout.

That way, we could get rid of a lot of the usage of Timeout.timeout for systems that do have getaddrinfo_a. For example, for Net::HTTP#connect we could easily then do something like this: https://github.com/ruby/ruby/compare/master...mohamedhafez:patch-3?diff=split.

The motivation for this is that the usage of Timeout.timeout is inherently unsafe, and it would be great to stop using it where we can (see https://www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/ and http://blog.headius.com/2008/02/ruby-threadraise-threadkill-timeoutrb.html)


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #17525: Implement Happy Eyeballs Version 2 (RFC8305) in Socket.tcpClosedGlass_saga (Masaki Matsushita)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0