puppetlabs/marionette-collective — pull request #235 by ploubser (2014-08-20 09:30:54+00:00)
Title: (MCO-453) Fix validator plugin load race condition

This commit fixes a race condition which occurs when validator plugins
are loaded for the first time by adding a mutex to the Validator
module.

The race condition happens when an agent thread tries to determine
whether it should load the validator plugins, determines that they have
already been loaded by looking at the last_load timestamp but the
validators are in reality still busy loading. By locking the mutex
before the call to #load_validators? we allow
PluginManager.find_and_load to finish before we try and determine if the
validators have been loaded or not.