Drb and "is recycled object" exception

The error means that you're trying to serve an object that's been garbage collected, which usually happens because the object went out of scope on the server.

Your safest bet is figuring out why the object was prematurely garbage-collected in the first place. Alternatively, you could disable the server's GC by calling GC.disable, which is usually a bad idea, especially if your server is long-running.


There is a way to delay garbage collection for the object passed to the client on the server:

  DRb.install_id_conv TimerIdConv.new 60 # one minute

See https://ruby-doc.org/stdlib-2.5.3/libdoc/drb/rdoc/DRb/TimerIdConv.html