puppetlabs/puppet-server — pull request #281 by cprice404 (2014-11-18 03:58:56+00:00)
Title: FOR REVIEW: (SERVER-150) flush jruby instances

FOR REVIEW: putting this branch up now for early review. I think it's reasonably complete except that it needs more tests, but the main goal is to let people assess the risk in terms of whether it's something we think is safe enough for 1.0 or whether we think it needs to be held back for a bit.

Probably easiest to review by commit.

-------------

This PR adds a new service function to the JRubyPuppet service.
The new function can be used to request a flush of the JRuby pool.

The function is implemented by creating a new (offline) JRuby pool
and starting to populate it; as soon as the first instance is ready,
we can swap it into the service and remove the old pool, and then
continue initializing the remaining instances and cleaning up the
old pool in parallel. It uses clojure agents to coordinate the
creation of the new pool and the cleanup of the old pool.