2008/4/22, Lars Christensen <larsch / belunktum.dk>:
> In a program with two DRb servers running (two time start_service), i

Why do you have two servers?

>  get the following deadlock after a while of running with a client
>  connecting to both servers:
>
>  deadlock 0x284c748: sleep:J(0x2c84f7c) (main) - server.rb:54
>  deadlock 0x2c84f7c: sleep:F(4)  - c:/lang/ruby/lib/ruby/1.8/drb/drb.rb:
>  944
>  deadlock 0x2d01338: sleep:F(5)  - c:/lang/ruby/lib/ruby/1.8/drb/drb.rb:
>  566
>  deadlock 0x2c854cc: sleep:F(3)  - c:/lang/ruby/lib/ruby/1.8/drb/drb.rb:
>  944
>  deadlock 0x2cff81c: sleep:S  - c:/lang/ruby/lib/ruby/1.8/drb/drb.rb:
>  626
>  c:/lang/ruby/lib/ruby/1.8/drb/drb.rb:626: Thread(0x2cff81c): deadlock
>  (fatal)
>
>  How can I debug this issue? I don't understand why it is a deadlock at
>  all, since drb.rb:944 is a call to Socket#accept, which does not
>  depend purely on other Ruby threads.
>
>  Any ideas?

For a deadlock you need at least two resources that are locked in
different order.  Maybe you have synchronized calls across the two
servers that deadlock.

You could use set_trace_func to trace program execution until the
deadlock and look at the execution flow.

Kind regards

robert


-- 
use.inject do |as, often| as.you_can - without end