From: Eric Hodel Date: 2005-11-16T08:12:31+09:00 Subject: Re: DRb Crashing On Nov 15, 2005, at 12:52 PM, James Edward Gray II wrote: > If I launch this server: > > #!/usr/local/bin/ruby > > require "drb" > require "rinda/tuplespace" > > tuplespace = Rinda::TupleSpace.new > DRb.start_service("druby://localhost:61676", tuplespace) > > loop do > nums = Array.new(rand(9) + 2) { rand(10) + 1 } > ops = Array.new(nums.size - 1) { %w{+ - * /}[rand(4)] } > problem = nums.zip(ops).flatten.compact.join(" ") > > tuplespace.write(["Problem", problem]) > puts tuplespace.take(["Result", String]).last > end > > __END__ > > Then run this client: > > #!/usr/local/bin/ruby -w > > require "drb" > require "rinda/tuplespace" > > DRb.start_service > tuplespace = Rinda::TupleSpaceProxy.new( > DRbObject.new_with_uri("druby://localhost:61676") > ) > > while problem = tuplespace.take(["Problem", %r{^\d+(?: [-+*/] \d+)+ > $}]) > tuplespace.write(["Result", "#{problem.last} = #{eval > problem.last}"]) > end > > __END__ > > The client crashes, generally within a few seconds. Adding a sleep > inside the server loop seems to resolve the issue. With what error? > Anyone know why? I've had better luck with these kinds of errors by placing the TupleSpace in its own process. -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04