# DRb Connection Closed Error?!?!?!?

**URL:** <https://rubytalk.org/t/drb-connection-closed-error/11389>\
**Category:** ruby-talk\
**Created:** [6 May 2004 16:38 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389 "2004-05-06T16:38:58Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ken\_Hilton1](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Ken\_Hilton1](https://rubytalk.org/u/Ken_Hilton1)\
**Post date:** [6 May 2004 16:38 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/1 "2004-05-06T16:38:58Z")

</div>

Greetings,

Can anyone explain to me why this very simple little DRb client server pair  
generates a DRb::DRbConnError when the client terminates? I’ve checked out  
the books and the samples and I can’t see what I’m missing. I’m running  
Ruby 1.8.1 on Win2000 and WinXP. The problem reproduces w/the pair running  
on the same machine or (with the host id modified) when each is running on  
separate machines.

Instructions: Run drbsvr.rb first, then run the drbclnt.rb. The output I  
get from ruby follows below.

PS. I am unable to rescue the error that was raised by DRb, which BTW  
puzzles me further.

Thanks for any help you can lend.

Ken.

> **···**
>
> * * *
> 
> # drb server
> 
> require ‘drb’
> 
> class MySvr  
> def svc  
> puts "MySvr::svc called."  
> return "Service completed."  
> end  
> end
> 
> $stdout.sync=true;
> 
> while true  
> begin  
> puts "Starting MySvr…"  
> DRb.start\_service(“druby://localhost:9000”, MySvr.new());  
> DRb.thread.join;  
> DRb.stop\_service;  
> rescue DRb::DRbConnError  
> puts "Rescued DRbConnectionClosed: #{$!}"  
> end  
> end
> 
> * * *
> 
> # drb client
> 
> require ‘drb’
> 
> ## DRb.start\_service(nil,nil); svr = DRbObject.new(nil, “druby://localhost:9000”) 10.times do puts svr.svc(); end DRb.stop\_service;
> 
> Output:(rdb:1) c  
> Starting MySvr…  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> e:/tools/ruby/lib/ruby/site\_ruby/1.8/drb/drb.rb:104: `connection closed' (DRb::D RbConnError) from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:596:in`start’  
> from e:/tools/ruby/lib/ruby/site\_ruby/1.8/drb/drb.rb:596:in `run' from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:549:in`initialize’
> 
> ```
> from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:737:in `new'
> from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:737:in
> 
> ```
> 
> `start\_servi  
> ce’  
> from H:/qbbpo/src/vendornet/etc/drbsvr.rb:17  
> e:/tools/ruby/lib/ruby/site\_ruby/1.8/drb/drb.rb:104:  
> raise(DRbConnError, ‘c  
> onnection closed’) if sz.nil?  
> (rdb:3)

---

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@Joel\_VanderWerf1](https://rubytalk.org/u/Joel_VanderWerf1)\
**Post date:** [6 May 2004 18:05 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/2 "2004-05-06T18:05:54Z")

</div>

Ken Hilton wrote:

> Greetings,
> 
> Can anyone explain to me why this very simple little DRb client server pair  
> generates a DRb::DRbConnError when the client terminates? I’ve checked out  
> the books and the samples and I can’t see what I’m missing. I’m running  
> Ruby 1.8.1 on Win2000 and WinXP. The problem reproduces w/the pair running  
> on the same machine or (with the host id modified) when each is running on  
> separate machines.

I realize this is not much help to you, but it works fine on linux, with  
either 1.8.1 or 1.9.0.

---

<div class="post-metadata">

**Author:** ![Ken\_Hilton1](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Ken\_Hilton1](https://rubytalk.org/u/Ken_Hilton1)\
**Post date:** [7 May 2004 20:18 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/3 "2004-05-07T20:18:55Z")

</div>

Here’s the code again, for your convenience. And, when I step through this,  
the error in the server occurs when the client process terminates, not when  
it stops its local DRb service session.

THANKS,

Ken.

-------------------- drbsvr.rb

# drb server

require ‘drb’

class MySvr  
def svc(stop)  
puts “MySvr::svc called.”  
return “Service completed.”  
end  
end

$stdout.sync=true;

while true  
begin  
puts “Starting MySvr…”  
DRb.start\_service(“druby://localhost:9000”, MySvr.new());  
DRb.thread.join;  
puts “MySvr has terminated”  
rescue DRb::DRbConnError  
puts “Rescued DRbConnectionClosed: #{$!}”  
end  
end

---------------drbclnt.rb

# drb client

require ‘drb’

begin

DRb.start\_service(nil,nil);  
svr = DRbObject.new(nil, “druby://localhost:9000”)  
10.times do  
puts svr.svc(false);  
end  
DRb.stop\_service;

rescue DRb::DRbConnError  
puts “Rescued #{$!}”  
end

------------Client output  
Debug.rb  
Emacs support available.

H:/qbbpo/src/vendornet/etc/  
(rdb:1) c  
Service completed.  
Service completed.  
Service completed.  
Service completed.  
Service completed.  
Service completed.  
Service completed.  
Service completed.  
Service completed.  
Service completed.  
Press any key to continue

------------ Server output & DRb error  
(rdb:1) c  
Starting MySvr…  
MySvr::svc called.  
MySvr::svc called.  
MySvr::svc called.  
MySvr::svc called.  
MySvr::svc called.  
MySvr::svc called.  
MySvr::svc called.  
MySvr::svc called.  
MySvr::svc called.  
MySvr::svc called.  
e:/tools/ruby/lib/ruby/site\_ruby/1.8/drb/drb.rb:104: `connection closed' (DRb:: RbConnError) from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:596:in `start’  
from e:/tools/ruby/lib/ruby/site\_ruby/1.8/drb/drb.rb:596:in `run' from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:549:in `initialize

```
    from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:737:in `new'
    from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:737:in

```

`start\_serv  
ce’  
from H:/qbbpo/src/vendornet/etc/drbsvr.rb:17  
e:/tools/ruby/lib/ruby/site\_ruby/1.8/drb/drb.rb:104:  
raise(DRbConnError, ’  
onnection closed’) if sz.nil?  
(rdb:3)

“Ken Hilton” [kenosis@comcast.net](mailto:kenosis@comcast.net) wrote in message  
news:iStmc.42859$I%1.2775243@attbi\_s51…

> Greetings,
> 
> Can anyone explain to me why this very simple little DRb client server  
> pair  
> generates a DRb::DRbConnError when the client terminates? I’ve checked  
> out  
> the books and the samples and I can’t see what I’m missing. I’m running  
> Ruby 1.8.1 on Win2000 and WinXP. The problem reproduces w/the pair  
> running  
> on the same machine or (with the host id modified) when each is running on  
> separate machines.
> 
> Instructions: Run drbsvr.rb first, then run the drbclnt.rb. The output I  
> get from ruby follows below.
> 
> PS. I am unable to rescue the error that was raised by DRb, which BTW  
> puzzles me further.
> 
> Thanks for any help you can lend.
> 
> Ken.
> 
> * * *
> 
> # drb server
> 
> require ‘drb’
> 
> class MySvr  
> def svc  
> puts “MySvr::svc called.”  
> return “Service completed.”  
> end  
> end
> 
> $stdout.sync=true;
> 
> while true  
> begin  
> puts “Starting MySvr…”  
> DRb.start\_service(“druby://localhost:9000”, MySvr.new());  
> DRb.thread.join;  
> DRb.stop\_service;  
> rescue DRb::DRbConnError  
> puts “Rescued DRbConnectionClosed: #{$!}”  
> end  
> end
> 
> * * *
> 
> # drb client
> 
> require ‘drb’
> 
> ## DRb.start\_service(nil,nil); svr = DRbObject.new(nil, “druby://localhost:9000”) 10.times do puts svr.svc(); end DRb.stop\_service;
> 
> Output:(rdb:1) c  
> Starting MySvr…  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> MySvr::svc called.  
> e:/tools/ruby/lib/ruby/site\_ruby/1.8/drb/drb.rb:104: `connection closed' (DRb::D RbConnError) from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:596:in `start’

> **···**
>
> > ```
> > from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:596:in `run'
> > from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:549:in
> > 
> > ```
> > 
> > `initialize’
> > 
> > ```
> > from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:737:in `new'
> > from e:/tools/ruby/lib/ruby/site_ruby/1.8/drb/drb.rb:737:in
> > 
> > ```
> > 
> > `start\_servi  
> > ce’  
> > from H:/qbbpo/src/vendornet/etc/drbsvr.rb:17  
> > e:/tools/ruby/lib/ruby/site\_ruby/1.8/drb/drb.rb:104:  
> > raise(DRbConnError, ‘c  
> > onnection closed’) if sz.nil?  
> > (rdb:3)

---

<div class="post-metadata">

**Author:** ![Ken\_Hilton1](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Ken\_Hilton1](https://rubytalk.org/u/Ken_Hilton1)\
**Post date:** [6 May 2004 21:03 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/4 "2004-05-06T21:03:58Z")

</div>

I figured as much. This is the second window’s specific issue I’ve  
uncovered since upgrading to 1.8.1. Hopefully one of the WinRuby wizards  
out there will have an idea. Thx! 🙂

Ken.

“Joel VanderWerf” [vjoel@PATH.Berkeley.EDU](mailto:vjoel@PATH.Berkeley.EDU) wrote in message  
news:409A7E7A.9090409@path.berkeley.edu…

> Ken Hilton wrote:
> 
> > Greetings,
> > 
> > Can anyone explain to me why this very simple little DRb client server  
> > pair  
> > generates a DRb::DRbConnError when the client terminates? I’ve checked  
> > out  
> > the books and the samples and I can’t see what I’m missing. I’m running  
> > Ruby 1.8.1 on Win2000 and WinXP. The problem reproduces w/the pair  
> > running  
> > on the same machine or (with the host id modified) when each is running  
> > on

> **···**
>
> > > separate machines.
> > 
> > I realize this is not much help to you, but it works fine on linux, with  
> > either 1.8.1 or 1.9.0.

---

<div class="post-metadata">

**Author:** ![Zach\_Dennis1](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@Zach\_Dennis1](https://rubytalk.org/u/Zach_Dennis1)\
**Post date:** [7 May 2004 20:28 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/5 "2004-05-07T20:28:36Z")

</div>

I see there is a Metro-Detroit Ruby’s User Group which was posted by Mike  
Sassak in Feb. of 2002. I haven’t seen Mike Sassak post in quite a while, is  
he still around? I’m in the Grand Rapids area and I am looking for other  
West Michigan Ruby folks. Any out there?

Feel free to email me off list,

Zach Dennis  
Market Technologies Inc.

---

<div class="post-metadata">

**Author:** ![Ken\_Hilton1](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Ken\_Hilton1](https://rubytalk.org/u/Ken_Hilton1)\
**Post date:** [10 May 2004 18:58 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/6 "2004-05-10T18:58:54Z")

</div>

Joel VanderWerf [vjoel@PATH.Berkeley.EDU](mailto:vjoel@PATH.Berkeley.EDU) wrote in message news:[409A7E7A.9090409@path.berkeley.edu](mailto:409A7E7A.9090409@path.berkeley.edu)…

> Ken Hilton wrote:
> 
> > Greetings,
> > 
> > Can anyone explain to me why this very simple little DRb client server pair  
> > generates a DRb::DRbConnError when the client terminates? I’ve checked out  
> > the books and the samples and I can’t see what I’m missing. I’m running  
> > Ruby 1.8.1 on Win2000 and WinXP. The problem reproduces w/the pair running  
> > on the same machine or (with the host id modified) when each is running on  
> > separate machines.
> 
> I realize this is not much help to you, but it works fine on linux, with  
> either 1.8.1 or 1.9.0.

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). When I happened to  
test the code I wrote to isolate this problem NOT in debug mode, the  
problem does not manifest (as I suppose others who ran the program  
experienced.) So, my new question is this: do any of you see this  
problem when you run my test app in debug mode and if so, what do you  
make of it? Is it perhaps a feature and not a debug (a diagnostic  
perhaps?)

Cheers,

Ken.

---

<div class="post-metadata">

**Author:** ![daz](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@daz](https://rubytalk.org/u/daz)\
**Post date:** [7 May 2004 10:53 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/7 "2004-05-07T10:53:56Z")

</div>

Ken Hilton wrote:

> Joel VanderWerf wrote:
> 
> > Ken Hilton wrote:
> > 
> > > Can anyone explain to me why this very simple little DRb client  
> > > server pair generates a DRb::DRbConnError when the client terminates?  
> > > I’ve checked out the books and the samples and I can’t see what I’m  
> > > missing. I’m running Ruby 1.8.1 on Win2000 and WinXP.  
> > > The problem reproduces w/the pair running on the same machine  
> > > or (with the host id modified) when each is running on  
> > > separate machines.
> > 
> > I realize this is not much help to you, but it works fine on linux, with  
> > either 1.8.1 or 1.9.0.
> 
> I figured as much. This is the second window’s specific issue I’ve  
> uncovered since upgrading to 1.8.1. Hopefully one of the WinRuby wizards  
> out there will have an idea. Thx! 🙂
> 
> Ken.

Works for me, too on Win98se (Ruby 1.8.0 & 1.9.0).

> > > PS. I am unable to rescue the error that was raised by DRb, which BTW  
> > > puzzles me further.

The DRb::DRbConnError must be happening on the client side -  
try a rescue there.

> **···**
>
> * * *
> 
> While you’re delving in this area, I see that William Webber has  
> profusely documented the dRuby 2.0.4 source code – same version as you have  
> but now three times the size !!  
> [http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/drb/drb.rb?rev=1.11.2.5;content-type=text%2Fplain](http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/drb/drb.rb?rev=1.11.2.5;content-type=text%2Fplain)
> 
> Cheers,
> 
> daz

---

<div class="post-metadata">

**Author:** ![daz](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@daz](https://rubytalk.org/u/daz)\
**Post date:** [11 May 2004 12:48 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/8 "2004-05-11T12:48:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ken\_Hilton1](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Ken\_Hilton1](https://rubytalk.org/u/Ken_Hilton1)\
**Post date:** [7 May 2004 16:18 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/9 "2004-05-07T16:18:56Z")

</div>

I upgraded Win Ruby’s DRb to the very latest version and the problem  
persists. Also, the error being raised does appear to be on the server  
side. Still hoping for some help here to keep my project viable and on  
track.

Ken.

“daz” [dooby@d10.karoo.co.uk](mailto:dooby@d10.karoo.co.uk) wrote in message  
[news:HsucnTcqg-of9wbdSa8jmw@karoo.co.uk](mailto:news:HsucnTcqg-of9wbdSa8jmw@karoo.co.uk)…

> Ken Hilton wrote:
> 
> > Joel VanderWerf wrote:
> > 
> > > Ken Hilton wrote:
> > > 
> > > > Can anyone explain to me why this very simple little DRb client  
> > > > server pair generates a DRb::DRbConnError when the client  
> > > > terminates?  
> > > > I’ve checked out the books and the samples and I can’t see what I’m  
> > > > missing. I’m running Ruby 1.8.1 on Win2000 and WinXP.  
> > > > The problem reproduces w/the pair running on the same machine  
> > > > or (with the host id modified) when each is running on  
> > > > separate machines.
> > > 
> > > I realize this is not much help to you, but it works fine on linux,  
> > > with  
> > > either 1.8.1 or 1.9.0.
> > 
> > I figured as much. This is the second window’s specific issue I’ve  
> > uncovered since upgrading to 1.8.1. Hopefully one of the WinRuby  
> > wizards  
> > out there will have an idea. Thx! 🙂
> > 
> > Ken.
> 
> Works for me, too on Win98se (Ruby 1.8.0 & 1.9.0).
> 
> > > > PS. I am unable to rescue the error that was raised by DRb, which  
> > > > BTW  
> > > > puzzles me further.
> 
> The DRb::DRbConnError must be happening on the client side -  
> try a rescue there.
> 
> * * *
> 
> While you’re delving in this area, I see that William Webber has  
> profusely documented the dRuby 2.0.4 source code – same version as you  
> have  
> but now three times the size !!

[http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/drb/drb.rb?rev=1.11.2.5;content-type=text%2Fplain](http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/drb/drb.rb?rev=1.11.2.5;content-type=text%2Fplain)

> **···**
>
> > Cheers,
> > 
> > daz

---

<div class="post-metadata">

**Author:** ![Ken\_Hilton1](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Ken\_Hilton1](https://rubytalk.org/u/Ken_Hilton1)\
**Post date:** [7 May 2004 16:43 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/10 "2004-05-07T16:43:55Z")

</div>

Tried the DRB at the link you provide and Ruby for windows 1.8.1-13-rc2 and  
the problem persists. I continue to hope someone out there can help me out  
so my project can remain viable and on track. Thanks,

Ken.

PS. The error raised by DRb appears to be on the server side and only is  
raised when the client process exits, not when the DRb client side service  
is stopped.

“daz” [dooby@d10.karoo.co.uk](mailto:dooby@d10.karoo.co.uk) wrote in message  
[news:HsucnTcqg-of9wbdSa8jmw@karoo.co.uk](mailto:news:HsucnTcqg-of9wbdSa8jmw@karoo.co.uk)…

> Ken Hilton wrote:
> 
> > Joel VanderWerf wrote:
> > 
> > > Ken Hilton wrote:
> > > 
> > > > Can anyone explain to me why this very simple little DRb client  
> > > > server pair generates a DRb::DRbConnError when the client  
> > > > terminates?  
> > > > I’ve checked out the books and the samples and I can’t see what I’m  
> > > > missing. I’m running Ruby 1.8.1 on Win2000 and WinXP.  
> > > > The problem reproduces w/the pair running on the same machine  
> > > > or (with the host id modified) when each is running on  
> > > > separate machines.
> > > 
> > > I realize this is not much help to you, but it works fine on linux,  
> > > with  
> > > either 1.8.1 or 1.9.0.
> > 
> > I figured as much. This is the second window’s specific issue I’ve  
> > uncovered since upgrading to 1.8.1. Hopefully one of the WinRuby  
> > wizards  
> > out there will have an idea. Thx! 🙂
> > 
> > Ken.
> 
> Works for me, too on Win98se (Ruby 1.8.0 & 1.9.0).
> 
> > > > PS. I am unable to rescue the error that was raised by DRb, which  
> > > > BTW  
> > > > puzzles me further.
> 
> The DRb::DRbConnError must be happening on the client side -  
> try a rescue there.
> 
> * * *
> 
> While you’re delving in this area, I see that William Webber has  
> profusely documented the dRuby 2.0.4 source code – same version as you  
> have  
> but now three times the size !!

[http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/drb/drb.rb?rev=1.11.2.5;content-type=text%2Fplain](http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/~checkout~/ruby/lib/drb/drb.rb?rev=1.11.2.5;content-type=text%2Fplain)

> **···**
>
> > Cheers,
> > 
> > daz

---

<div class="post-metadata">

**Author:** ![Nathaniel\_Talbott1](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nathaniel\_Talbott1](https://rubytalk.org/u/Nathaniel_Talbott1)\
**Post date:** [7 May 2004 16:26 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/11 "2004-05-07T16:26:29Z")

</div>

Can we see your rescue code? I would guess that there’s an issue there  
that’s causing this problem. As to the more general problem of why the  
error’s being raised in the first place, it would help a lot to debug  
it if you could reduce it to a very simple case and post the code here,  
along with OS information for where you’re running the client and  
server.

Thanks,

Nathaniel  
Terralien, Inc.

\<:((\>\<

> **···**
>
> On May 7, 2004, at 11:18, Ken Hilton wrote:
> 
> > > > > > PS. I am unable to rescue the error that was raised by DRb, which  
> > > > > > BTW puzzles me further.

---

<div class="post-metadata">

**Author:** ![Ken\_Hilton1](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Ken\_Hilton1](https://rubytalk.org/u/Ken_Hilton1)\
**Post date:** [7 May 2004 19:18 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/12 "2004-05-07T19:18:56Z")

</div>

Hi Nathaniel,

Thanks for posting. The sample code, OS info and output are in the head  
item of this new thread. I can send it to you directly if that helps. And  
agin THANKS for replying as I’m rather over a barrel at this point 🙂

-Ken.

“Nathaniel Talbott” [nathaniel@talbott.ws](mailto:nathaniel@talbott.ws) wrote in message  
news:464D2E7C-A043-11D8-86DE-000A95CD7A8E@talbott.ws…

> **···**
>
> > On May 7, 2004, at 11:18, Ken Hilton wrote:
> > 
> > > > > > > PS. I am unable to rescue the error that was raised by DRb, which  
> > > > > > > BTW puzzles me further.
> > 
> > Can we see your rescue code? I would guess that there’s an issue there  
> > that’s causing this problem. As to the more general problem of why the  
> > error’s being raised in the first place, it would help a lot to debug  
> > it if you could reduce it to a very simple case and post the code here,  
> > along with OS information for where you’re running the client and  
> > server.
> > 
> > Thanks,
> > 
> > Nathaniel  
> > Terralien, Inc.
> > 
> > \<:((\>\<

---

<div class="post-metadata">

**Author:** ![Nathaniel\_Talbott1](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nathaniel\_Talbott1](https://rubytalk.org/u/Nathaniel_Talbott1)\
**Post date:** [7 May 2004 19:32 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/13 "2004-05-07T19:32:40Z")

</div>



---

<div class="post-metadata">

**Author:** ![Nathaniel\_Talbott1](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nathaniel\_Talbott1](https://rubytalk.org/u/Nathaniel_Talbott1)\
**Post date:** [7 May 2004 19:33 UTC](https://rubytalk.org/t/drb-connection-closed-error/11389/14 "2004-05-07T19:33:21Z")

</div>

Oops… should’ve backtracked a bit more :-/

I think the reason you’re not able to rescue the exception is because  
it is raised in a thread that DRb starts, and thus terminates that  
thread when it occurs. It never propagates to the thread in which you  
have the rescue.

I’ll mull over the more general problem a bit more, as I seem to  
remember encountering it on a project I did a few months ago.

HTH,

Nathaniel  
Terralien, Inc.

\<:((\>\<

> **···**
>
> On May 7, 2004, at 14:18, Ken Hilton wrote:
> 
> > Thanks for posting. The sample code, OS info and output are in the  
> > head  
> > item of this new thread. I can send it to you directly if that helps.  
> > And  
> > agin THANKS for replying as I’m rather over a barrel at this point 🙂
