https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112015-08-14T04:54:49ZRuby Issue Tracking SystemRuby master - Bug #11443: DNS name resolution takes twice as long as it should when primary name server is unavailablehttps://redmine.ruby-lang.org/issues/11443?journal_id=537812015-08-14T04:54:49Znemski (Patrick Robinson)therealpatrobinson@gmail.com
<ul><li><strong>Subject</strong> changed from <i>DNS name resolution takes a twice as long as it should when primary name server is unavailable</i> to <i>DNS name resolution takes twice as long as it should when primary name server is unavailable</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/53781/diff?detail_id=38662">diff</a>)</li></ul> Ruby master - Bug #11443: DNS name resolution takes twice as long as it should when primary name server is unavailablehttps://redmine.ruby-lang.org/issues/11443?journal_id=538012015-08-15T10:54:44Znemski (Patrick Robinson)therealpatrobinson@gmail.com
<ul></ul><p>Doing an strace I can see the DNS lookup occurs twice (with and without a failing name server):</p>
<pre><code>[pid 32129] socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 7
[pid 32129] connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("1.1.1.1")}, 16) = 0
[pid 32129] poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
[pid 32129] sendto(7, "\271\254\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\34\0\1", 28, MSG_NOSIGNAL, NULL, 0) = 28
[pid 32129] poll([{fd=7, events=POLLIN}], 1, 3000) = 0 (Timeout)
[pid 32129] socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 8
[pid 32129] connect(8, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("8.8.8.8")}, 16) = 0
[pid 32129] poll([{fd=8, events=POLLOUT}], 1, 0) = 1 ([{fd=8, revents=POLLOUT}])
[pid 32129] sendto(8, "\271\254\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\34\0\1", 28, MSG_NOSIGNAL, NULL, 0) = 28
[pid 32129] poll([{fd=8, events=POLLIN}], 1, 2000) = 1 ([{fd=8, revents=POLLIN}])
[pid 32129] ioctl(8, FIONREAD, [56]) = 0
[pid 32129] recvfrom(8, "\271\254\201\200\0\1\0\1\0\0\0\0\6google\3com\0\0\34\0\1\300\f\0\34"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("8.8.8.8")}, [16]) = 56
[pid 32129] close(7) = 0
[pid 32129] close(8) = 0
[pid 32129] stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=226, ...}) = 0
[pid 32129] socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 7
[pid 32129] connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("1.1.1.1")}, 16) = 0
[pid 32129] poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
[pid 32129] sendto(7, "\366N\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\1\0\1", 28, MSG_NOSIGNAL, NULL, 0) = 28
[pid 32129] poll([{fd=7, events=POLLIN}], 1, 3000) = 0 (Timeout)
[pid 32129] socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 8
[pid 32129] connect(8, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("8.8.8.8")}, 16) = 0
[pid 32129] poll([{fd=8, events=POLLOUT}], 1, 0) = 1 ([{fd=8, revents=POLLOUT}])
[pid 32129] sendto(8, "\366N\1\0\0\1\0\0\0\0\0\0\6google\3com\0\0\1\0\1", 28, MSG_NOSIGNAL, NULL, 0) = 28
[pid 32129] poll([{fd=8, events=POLLIN}], 1, 2000) = 1 ([{fd=8, revents=POLLIN}])
[pid 32129] ioctl(8, FIONREAD, [220]) = 0
[pid 32129] recvfrom(8, "\366N\201\200\0\1\0\f\0\0\0\0\6google\3com\0\0\1\0\1\300\f\0\1"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("8.8.8.8")}, [16]) = 220
[pid 32129] close(7) = 0
[pid 32129] close(8) = 0
</code></pre> Ruby master - Bug #11443: DNS name resolution takes twice as long as it should when primary name server is unavailablehttps://redmine.ruby-lang.org/issues/11443?journal_id=538022015-08-15T12:04:57Znemski (Patrick Robinson)therealpatrobinson@gmail.com
<ul><li><strong>ruby -v</strong> changed from <i>ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]</i> to <i>ruby 2.3.0dev (2015-08-13) [x86_64-linux]</i></li></ul> Ruby master - Bug #11443: DNS name resolution takes twice as long as it should when primary name server is unavailablehttps://redmine.ruby-lang.org/issues/11443?journal_id=568932016-02-04T22:54:51Znemski (Patrick Robinson)therealpatrobinson@gmail.com
<ul></ul><p>I retested this again today and could only replicate it on Ubuntu Lucid, not Ubuntu Trusty or Debian Jessie.</p> Ruby master - Bug #11443: DNS name resolution takes twice as long as it should when primary name server is unavailablehttps://redmine.ruby-lang.org/issues/11443?journal_id=806782019-08-13T04:03:01Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul>