Feature #1811
closedDefault BasicSocket.do_not_reverse_lookup to true
Description
=begin
Currently ruby socket code defaults to always doing reverse DNS lookup
[ex: once per incoming UDP packet, once per TCP connection].
This causes "surprising" pauses if lookup fails, because the DNS
waits 15s to timeout, before passing the packet back to the program,
the pauses are surprising, not appropriate for production, cause bugs[1] and cause an overly chatty network.
Proposal is: default do_not_reverse_lookup to true and/or change name to do_reverse_lookup= to avoid double negative.
See discussions:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/24247
http://www.ruby-forum.com/topic/190013
Thanks.
=r
[1] http://www.ruby-forum.com/topic/191022
=end
Files
Updated by djberg96 (Daniel Berger) over 15 years ago
=begin
I agree, although I'd favor getting rid of the 'do_' and just make it Socket.reverse_lookup=
Regards,
Dan
=end
Updated by wyhaines (Kirk Haines) over 15 years ago
=begin
This seems completely reasonable to me. Most serious networking code
is going to disable the reverse DNS lookups anyway, so Ruby may as
well default to the option most code is going to want.
Kirk Haines
=end
Updated by rogerdpack (Roger Pack) about 15 years ago
=begin
Here's a patch that does it. None of the documentation seems to mention that it defaults to true, so this should be enough for now.
Socket doesn't appears to have a maintainer [1] so anybody want to?
Thanks.
-r
[1] http://redmine.ruby-lang.org/wiki/ruby/Maintainers
=end
Updated by rogerdpack (Roger Pack) about 15 years ago
=begin
Interestingly, when I apply this patch, then run make test-all, two tests that previously broke:
-
Error:
test_cookie(TestCookie):
NoMethodError: undefined methodshutdown' for nil:NilClass /home/rdp/dev/downloads/ruby_trunk/test/xmlrpc/webrick_testing.rb:32:in
block in stop_server' -
Error:
test_client_server(Test_Webrick):
NoMethodError: undefined methodshutdown' for nil:NilClass /home/rdp/dev/downloads/ruby_trunk/test/xmlrpc/webrick_testing.rb:32:in
block in stop_server'
Now succeed happily--appears that there's a timing issue where the setup thread is not completing early enough because it is blocked doing DNS lookups :)
Thanks.
-r
=end
Updated by ujihisa (Tatsuhiro Ujihisa) almost 15 years ago
- Status changed from Open to Assigned
- Assignee set to nobu (Nobuyoshi Nakada)
=begin
=end
Updated by nobu (Nobuyoshi Nakada) almost 15 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r26541.
Roger, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end