Bug #12702

DRb client fails when calling out-of-process remote method with a block

Added by djellemah (John Anderson) about 4 years ago. Updated about 1 year ago.

Target version:
ruby -v:
ruby 2.4.0dev (2016-08-24 trunk 55999) [x86_64-linux]


See attached code for test case.

applies to ruby-2.3.1 and ruby-2.4.0dev (2016-08-24 trunk 55999)

The problem starts in DRbObject#method_missing where
the code following is used for the in-process case which works.

But the code in the block for

succ, result = self.class.with_friend(uri (Uri Gorelik)) do

is used for the out-of-process case. Here, DrbMessage#send_request fails
because b is a Proc, and in DrbMessage#dump the call to make_proxy fails
because fails.


drb_block_error.rb (1.46 KB) drb_block_error.rb code to reproduce the problem djellemah (John Anderson), 08/24/2016 11:45 AM

Updated by jeremyevans0 (Jeremy Evans) about 1 year ago

  • Status changed from Open to Rejected

This is a bug in your code, you are not calling DRb.start_service in the client program. The client program needs a DRb server running in order to handle the sending-block-to-remote-method case. See the example in the "Client code" section of the DRb module rdoc.

Also available in: Atom PDF