> This fix attemps to resolve an issue where threads can stack up on each other > while waiting to get a connection from the ldap pool to an unreachable > server. It does this by having each thread start a countdown prior to holding > the pools' lock. (which has been changed to a ReentrantLock) Once the lock > has been grabbed, the timeout is adjusted to take the waiting time into > account and the process of getting a connection from the pool or creating a > new one commences. > > Note: this fix also changes the meaning of the connection pools initSize > somewhat. In a situation where we have a large initSize and a small timeout > the first thread could actually exhaust the timeout before creating all of > its initial connections. Instead this fix simply creates a single connection > per pool-connection-request. It continues to do so for subsequent requests > regardless of whether an existing unused connection is available in the pool > until initSize is exhausted. As such it may require a CSR.
Rob McKenna has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: - Add method to guard long to int cast - Allow the test to pass on MacOSX - JDK-8277795: whitespace - Add test - JDK-8277795: formatting - JDK-8277795: whitespace cleanup - JDK-8277795: ldap connection timeout not honoured under contention ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/6568/files - new: https://git.openjdk.java.net/jdk/pull/6568/files/7c277622..6af94f37 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6568&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6568&range=02-03 Stats: 73668 lines in 2120 files changed: 50786 ins; 12701 del; 10181 mod Patch: https://git.openjdk.java.net/jdk/pull/6568.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/6568/head:pull/6568 PR: https://git.openjdk.java.net/jdk/pull/6568