1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/socket
Kir Shatrov 2038cc6cab
Make Socket.getaddrinfo interruptible (#2827)
Before, Socket.getaddrinfo was using a blocking getaddrinfo(3) call.
That didn't allow to wrap it into Timeout.timeout or interrupt the thread in any way.

Combined with the default 10 sec resolv timeout on many Unix systems, this can
have a very noticeable effect on production Ruby apps being not
resilient to DNS outages and timing out name resolution, and being unable to fail fast even
with Timeout.timeout.

Since we already have support for getaddrinfo_a(3), the async version
of getaddrinfo, we should be able to make Socket.getaddrinfo leverage that
when getaddrinfo_a version is available in the system (hence #ifdef
HAVE_GETADDRINFO_A).

Related tickets:
https://bugs.ruby-lang.org/issues/16476
https://bugs.ruby-lang.org/issues/16381
https://bugs.ruby-lang.org/issues/14997
2020-08-27 16:39:13 +09:00
..
test_addrinfo.rb Make Socket.getaddrinfo interruptible (#2827) 2020-08-27 16:39:13 +09:00
test_ancdata.rb
test_basicsocket.rb
test_nonblock.rb
test_socket.rb
test_sockopt.rb
test_tcp.rb
test_udp.rb
test_unix.rb