basho/riak-java-client — pull request #230 by broach (2013-05-07 23:41:51+00:00)
Title: Pb connection pool permit fix

The old PB client's connection pool uses a Semaphore to control connection creation. This creates a situation where once maxConnections is reached and all connections are checked out any thread attempting to get a connection from the pool will block on the semaphore and timeout unless an existing connection is disconnected/lost. Connections returned to the pool go unnoticed by any thread waiting on the permit.

These changes make it so the semaphore is used for access to the pool itself. If maxConnections has been reached and all connections are currently in use, a thread will block on the semaphore until one is returned to the pool or the timeout is reached.