Issue #496 has been updated by Brian Candler.


I suspect a DNS/hostname resolution problem on your system.

Looking at 1.8.6p114, notice that DRbTCPSocket.getservername first calls Socket.gethostname to get the hostname, then calls Socket.gethostbyname which does both forward and reverse name resolution, presumably to map to a "canonical" name. Then DRbTCPSocket.open_server_inaddr_any also calls Socket.getaddrinfo, although it discards the results apart from using them to decide whether to bind to IPv4, IPv6, or both.

Try the following in irb - how long does each step take?

{{{
require 'socket'
h1 = Socket.gethostname
h2 = Socket.gethostbyname(h1)[0]
Socket.getaddrinfo(h2, nil, Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)
}}}

If one of these steps is slow, you may be able to solve the problem by adding an entry in /etc/resolv.conf to map your hostname to your primary interface IP.

----------------------------------------
http://redmine.ruby-lang.org/issues/show/496

----------------------------------------
http://redmine.ruby-lang.org