[#104307] Float truncate — Eustáquio Rangel <eustaquiorangel@...>
Hi!
4 messages
2021/06/16
[ruby-core:104427] [Ruby master Bug#18006] Resolv::DNS#getaddress takes minutes to resolve a domain with no DNS records in 3.0 (was quick in 2.7)
From:
merch-redmine@...
Date:
2021-06-28 18:25:10 UTC
List:
ruby-core #104427
Issue #18006 has been updated by jeremyevans0 (Jeremy Evans).
Backport changed from 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN to 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE
Status changed from Assigned to Closed
I tested this with RubyInstaller-head on Windows and the problem appears to have been resolved. Even without an empty `:search` option, ruby raises an exception almost immediately. As commit:9edc162583a4f685332239f6249745ad9b518cbe has already been backported to Ruby 3.0, I expect this issue will be fixed in Ruby 3.0.2.
----------------------------------------
Bug #18006: Resolv::DNS#getaddress takes minutes to resolve a domain with no DNS records in 3.0 (was quick in 2.7)
https://bugs.ruby-lang.org/issues/18006#change-92677
* Author: dee-see (Dominic Couture)
* Status: Closed
* Priority: Normal
* Assignee: akr (Akira Tanaka)
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
* Backport: 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE
----------------------------------------
Hello team,
Calling `getaddress` on a domain that returns `NXDOMAIN` takes 2.5 minutes in Ruby 3.0, unless the domain is in FQDN form (with a trailing dot). I'll try to take a look and figure out what's happening, but I'm not familiar with the Ruby code base so I wanted to report this first. I reproduced the issue on my local machine and on a VPS so this isn't a local network problem.
2.7:
``` shell
$ ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
16:42:49 dee-see@glacier:tmp$ time ruby -r resolv -e 'Resolv::DNS.new(nameserver: "8.8.8.8").getaddress("doesnotexist.deesee.xyz.")'
Traceback (most recent call last):
1: from -e:1:in `<main>'
/home/dee-see/.rbenv/versions/2.7.2/lib/ruby/2.7.0/resolv.rb:379:in `getaddress': DNS result has no information for doesnotexist.deesee.xyz. (Resolv::ResolvError)
real 0m0.225s
user 0m0.091s
sys 0m0.020s
$ time ruby -r resolv -e 'Resolv::DNS.new(nameserver: "8.8.8.8").getaddress("doesnotexist.deesee.xyz")'
Traceback (most recent call last):
1: from -e:1:in `<main>'
/home/dee-see/.rbenv/versions/2.7.2/lib/ruby/2.7.0/resolv.rb:379:in `getaddress': DNS result has no information for doesnotexist.deesee.xyz (Resolv::ResolvError)
real 0m0.291s
user 0m0.079s
sys 0m0.021s
```
3.0, notice the time on the second try
```shell
$ ruby -v
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
$ time ruby -r resolv -e 'Resolv::DNS.new(nameserver: "8.8.8.8").getaddress("doesnotexist.deesee.xyz.")'
/home/dee-see/.rbenv/versions/3.0.1/lib/ruby/3.0.0/resolv.rb:379:in `getaddress': DNS result has no information for doesnotexist.deesee.xyz. (Resolv::ResolvError)
from -e:1:in `<main>'
real 0m0.240s
user 0m0.102s
sys 0m0.031s
$ time ruby -r resolv -e 'Resolv::DNS.new(nameserver: "8.8.8.8").getaddress("doesnotexist.deesee.xyz")'
/home/dee-see/.rbenv/versions/3.0.1/lib/ruby/3.0.0/resolv.rb:379:in `getaddress': DNS result has no information for doesnotexist.deesee.xyz (Resolv::ResolvError)
from -e:1:in `<main>'
real 2m30.363s
user 0m0.122s
sys 0m0.021s
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>