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 * ext/socket/lib/socket.rb: Specify frozen_string_literal: true. 2015-11-14 13:15:33 +00:00
test_basicsocket.rb Thread scheduler for light weight concurrency. 2020-05-14 22:10:55 +12:00
test_nonblock.rb Removed unused variables 2019-06-30 08:45:01 +09:00
test_socket.rb Test interfaces include localhost 2019-12-06 16:03:16 +09:00
test_sockopt.rb Sat Mar 5 09:17:54 2016 Rei Odaira <Rei.Odaira@gmail.com> 2016-03-05 00:29:39 +00:00
test_tcp.rb IPSocket#inspect 2017-04-14 10:03:43 +00:00
test_udp.rb tests: support Linux kernels with CONFIG_IPV6=n 2018-10-13 05:18:49 +00:00
test_unix.rb Fixed leaked fds 2020-05-06 12:45:01 +09:00