ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:102005] [Ruby master Feature#17528] Make Addrinfo.getaddrinfo fall back to Timeout.timeout for :resolv_timeout
@ 2021-01-11 20:53 mohamed.m.m.hafez
  2021-01-12  4:57 ` [ruby-core:102015] " akr
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mohamed.m.m.hafez @ 2021-01-11 20:53 UTC (permalink / raw)
  To: ruby-core

Issue #17528 has been reported by mohamedhafez (Mohamed Hafez).

----------------------------------------
Feature #17528: Make Addrinfo.getaddrinfo fall back to Timeout.timeout for :resolv_timeout
https://bugs.ruby-lang.org/issues/17528

* Author: mohamedhafez (Mohamed Hafez)
* Status: Open
* Priority: Normal
----------------------------------------
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)  



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-13 20:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 20:53 [ruby-core:102005] [Ruby master Feature#17528] Make Addrinfo.getaddrinfo fall back to Timeout.timeout for :resolv_timeout mohamed.m.m.hafez
2021-01-12  4:57 ` [ruby-core:102015] " akr
2021-01-13 16:05 ` [ruby-core:102063] " mohamed.m.m.hafez
2021-01-13 17:50 ` [ruby-core:102069] " akr
2021-01-13 20:50 ` [ruby-core:102072] " mohamed.m.m.hafez

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 read-only IMAP folder(s) and NNTP newsgroup(s).