Skip to content

Commit

Permalink
Make DRb::DRbServer.load_limit configurable
Browse files Browse the repository at this point in the history
Make the DRb::DRbServer.load_limit config variable configurable through
worker settings.

https://bugzilla.redhat.com/show_bug.cgi?id=1573588
  • Loading branch information
agrare committed May 1, 2018
1 parent 272ff5a commit c974d91
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/VMwareWebService/MiqVimBroker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ def to_obj(ref)

attr_reader :shuttingDown

MB = 1048576
DRb::DRbServer.default_load_limit(50 * MB)

@@preLoad = false
@@debugUpdates = false
@@classModed = false
Expand All @@ -31,6 +28,7 @@ def to_obj(ref)
@@selectorHash = {}
@@maxWait = 60
@@maxObjects = 250
@@loadLimit = 25

def initialize(mode = :client, port = 9001)
if mode == :client
Expand Down Expand Up @@ -95,7 +93,7 @@ def new_with(uri, ref)

acl = ACL.new(%w( deny all allow 127.0.0.1/32 ))
DRb.install_acl(acl)
DRb.start_service("druby://127.0.0.1:#{port}", self, :idconv => VimBrokerIdConv.new)
DRb.start_service("druby://127.0.0.1:#{port}", self, :idconv => VimBrokerIdConv.new, :load_limit => @@loadLimit)
else
raise "MiqVimBroker: unrecognized mode #{mode}"
end
Expand Down Expand Up @@ -332,6 +330,14 @@ def self.maxObjects
@@maxObjects
end

def self.loadLimit=(val)
@@loadLimit = val
end

def self.loadLimit
@@loadLimit
end

def releaseSession(sessionId)
if @mode == :client
$vim_log.info "Client releaseSession: #{sessionId}"
Expand Down

0 comments on commit c974d91

Please sign in to comment.