From: daz Date: 2004-05-11T21:48:53+09:00 Subject: Re: DRb Connection Closed Error?!?!?!? Ken Hilton wrote: > > Greetings, > > Thanks to those of you who helped me out. It appears (today) that > I've resolved this problem, but I'm still not completely satisfied. > It turns out the macros and batch files I use during development > always launch ruby.exe in debug mode (-rdebug). Knowledge of that could make a considerable difference ;-) > [snip] So, my new question is this: do any of you see this > problem when you run my test app in debug mode [...] Y e s ( ruby 1.9.0 (2004-04-27) [i586-bccwin32], Win98se ) > [...] and if so, what do you make of it? As I'm a lower life-form, not a lot. require 'debug' # added to server script; run ... # ... give 'c' at debug prompt; run client # (changed loop to 3.times) --------------------------- D:/ruby/DfB/clr/DRb/server2_hilton.rb:12: (rdb:1) c Starting MySvr... MySvr::svc called. MySvr::svc called. MySvr::svc called. D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:558: `connection closed' (DRb::DRbConnError) from D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:1321:in `start' from D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:1321:in `run' from D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:1246:in `initialize' from D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:1502:in `new' from D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:1502:in `start_service' from D:/ruby/DfB/clr/DRb/server2_hilton.rb:29 D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:558: raise(DRbConnError, 'connection closed') if sz.nil? (rdb:3) w --> #1 D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:558:in `load' #2 D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:591:in `recv_request' #3 D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:855:in `recv_request' #4 D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:1406:in `init_with_client' #5 D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:1418:in `setup_message' #6 D:/RUBY/SRC_CVSINST/lib/ruby/1.9/drb/drb.rb:1388:in `perform' (rdb:3) --------------------------- A note to higher life-forms: I added a set_trace_func to drb.rb (outputting to a file) in order to provide some useful log data to pass on. Of course, whenever one carefully sets a trap, the bug decides to stay away :(( In drb.rb, replaced equal number of doc lines with code below to preserve reference lines. Gives full trace - but no DRb::DRbConnError (with require 'debug' still in the server script). #-------------- $tf = File.open('drbsrv2_trace.txt', 'w') END { $tf.close } # stf1 = lambda { | ev, fi, li, ty, bi, cl | $tf.printf("\n %20s :%4d: %25s %15s %8s ... ", File.basename(fi), li, ty, cl, ev) } stf2 = lambda { | ev, fi, li, ty, bi, cl | #?# set_trace_func(stf2) # dbg (inside thread) $tf.printf("\n %20s :%4d: %25s %15s %8s ... ", File.basename(fi), li, ty, cl, ev) } #set_trace_func(stf1) # dbg (main thread) # <---- [Note:1] #-------------- [Note:1] uncomment the line to "fix" the require 'debug' problem. Then disabled the trace and tried sprinkling "sleep 0.2" around to slow things down a different way -- no difference. daz