From: Miles Keaton Date: 2005-03-30T17:53:44+09:00 Subject: Re: DRb / dRuby - freezes on DRb::DRbUndumped - any ideas? On Mon, 28 Mar 2005 00:56:10 -0800, Miles Keaton wrote: > Using the "Remote objects under dRuby" example here: > http://www.ruby-doc.org/stdlib/libdoc/drb/rdoc/classes/DRb.html > Following it, exactly. > > But it freezes when it tries to call this line: > logger.log("Hello, world!") > Everything works until that point. > > This same freeze happens with > http://pragmaticprogrammer.com/titles/ruby/code/smp670.html > > What they all have in common is DRb::DRbUndumped - so I'm guessing > that's the problem. > > I'm running Ruby 1.8.2 on different/remote computers to do this test > (client names server by IP address.) > > It works when I run both on the same computer, but as soon as I try to > put client and server on different computers, it seems unable to use > objects passed by reference. > > NOTE where it froze, above. It's able to pass the object by > reference. It receives it back on the client. But when the client > tries to use it, that's when it freezes. > > I've tried this on various FreeBSD and Mac OS X computers, at home and > work, without firewalls. All other DRb code works fine except when > using DRbUndumped. I started putting little "pp" statements inside drb.rb to find out what was happening. Is there any reason that URI should ever be nil? See here: ~~~ DRbConn.open called REMOTE_URI: "druby://10.0.1.1:2001" @mutex: # CONN: nil ### DRbProtocol.open has been called URI: "druby://10.0.1.1:2001" FIRST?: true PROTOCOL:DRb::DRbTCPSocket === DRbTCPSocket.open has been called URI: "druby://10.0.1.1:2001" Parsing uri... HOST: "10.0.1.1" PORT: 2001 OPTION: nil Doing TCPSocket.open(host, port) SOC: # ~~~ DRbConn.open called REMOTE_URI: nil @mutex: # CONN: nil ### DRbProtocol.open has been called URI: nil FIRST?: true PROTOCOL:DRb::DRbTCPSocket === DRbTCPSocket.open has been called URI: nil Parsing uri... ### DRbProtocol.open has been called URI: nil FIRST?: false PROTOCOL:DRb::DRbTCPSocket === DRbTCPSocket.open has been called URI: nil Parsing uri... ~~~ DRbConn.open called REMOTE_URI: nil @mutex: # CONN: nil ### DRbProtocol.open has been called URI: nil FIRST?: true PROTOCOL:DRb::DRbTCPSocket === DRbTCPSocket.open has been called URI: nil Parsing uri... ### DRbProtocol.open has been called URI: nil FIRST?: false PROTOCOL:DRb::DRbTCPSocket === DRbTCPSocket.open has been called URI: nil Parsing uri... /usr/local/lib/ruby/1.8/drb/drb.rb:739:in `open': can't parse uri:nil (DRb::DRbConnError)