(POOLER-150) Synchronize checkout operations for API

This commit adds a shared mutex to vmpooler API so that checkout requests can be synchronized across threads. Without this change it is possible in some scenarios for vmpooler to allocate the same SUT to different API requests for a VM.
This commit is contained in:
kirby@puppetlabs.com 2019-10-21 14:24:34 -07:00
parent 79bd140ab9
commit 30bf2074fe
6 changed files with 27 additions and 14 deletions

View file

@ -36,10 +36,11 @@ module Vmpooler
use Vmpooler::API::Reroute
use Vmpooler::API::V1
def configure(config, redis, metrics)
def configure(config, redis, metrics, checkoutlock)
self.settings.set :config, config
self.settings.set :redis, redis
self.settings.set :metrics, metrics
self.settings.set :checkoutlock, checkoutlock
end
def execute!