Project

General

Profile

Actions

Feature #1811

closed

Default BasicSocket.do_not_reverse_lookup to true

Added by rogerdpack (Roger Pack) over 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
-
[ruby-core:24530]

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

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

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #496: DRb.start_service(nil) is very slowClosedseki (Masatoshi Seki)08/25/2008Actions
Actions #1

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

Actions #2

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

Actions #3

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

Actions #4

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:

  1. 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'

  2. 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

Actions #5

Updated by ujihisa (Tatsuhiro Ujihisa) almost 15 years ago

  • Status changed from Open to Assigned
  • Assignee set to nobu (Nobuyoshi Nakada)

=begin

=end

Actions #6

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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0