Bugs: Browse | Submit New | Admin

[#11060] DRb won't reliably stop_service

Date:
2007-05-23 04:06
Priority:
3
Submitted By:
Riley Lynch (rlynch)
Assigned To:
Akinori MUSHA (knu)
Category:
Network / Comm / Protocols
State:
Open
Platform:
 
Summary:
DRb won't reliably stop_service

Detailed description
Because of the way that DRb caches a DRbServer instance in @primary_server (whether instantiated via DRb::start_service,
or in some cases, DRbServer.new), you cannot be sure that your service will be entirely stopped: If the DRbServer is
cached in @primary_server, it will continue to serve local requests, even after server.stop_service has been issued.

DRb::stop_service guarantees to clear @primary_server, but at the cost of stopping whatever service has been installed
there. (Which depends on the order of instantiation, and which instantiation method was used.)

For now, to avoid surprises, I'm manually clearing this variable after instantiating a service:

  server = DRb::DRbServer.new(uri, Front.new)
  DRb.primary_server = nil

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
immortal.rb Sample code illustrating problem Download

Changes:

Field Old Value Date By
assigned_tonone2007-06-12 02:25zenspider
category_idMisc / Other Standard Library2007-05-29 21:33zenspider
File Added2019: immortal.rb2007-05-23 04:06rlynch