Feature #1811

Default BasicSocket.do_not_reverse_lookup to true

Added by Roger Pack almost 6 years ago. Updated almost 4 years ago.

[ruby-core:24530]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada

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

do_not_reverse_lookup.diff Magnifier (367 Bytes) Roger Pack, 10/10/2009 01:00 AM


Related issues

Related to Ruby trunk - Bug #496: DRb.start_service(nil) is very slow Closed 08/25/2008

History

#1 Updated by Daniel Berger almost 6 years ago

=begin
I agree, although I'd favor getting rid of the 'do_' and just make it Socket.reverse_lookup=

Regards,

Dan
=end

#2 Updated by Kirk Haines almost 6 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

#3 Updated by Roger Pack over 5 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

#4 Updated by Roger Pack over 5 years ago

=begin
Interestingly, when I apply this patch, then run make test-all, two tests that previously broke:

2) Error:
test_cookie(TestCookie):
NoMethodError: undefined method shutdown' for nil:NilClass
/home/rdp/dev/downloads/ruby_trunk/test/xmlrpc/webrick_testing.rb:32:in
block in stop_server'

11) Error:
test_client_server(Test_Webrick):
NoMethodError: undefined method shutdown' 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

#5 Updated by ujihisa . over 5 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

=begin

=end

#6 Updated by Nobuyoshi Nakada about 5 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

Also available in: Atom PDF