**Issue:**
testConnectionPoolTimeout starts both threads simultaneously, but with a
1ms pool timeout, there's no guarantee that thread 1 has actually
acquired the single connection before thread 2 tries. If both threads
race to the pool before either establishes a connection, the expected
timeout may never occur.
**The Fix:**
signal when the ForeverHandler has received a request (proving the
connection is occupied), then start the second thread.
**What Changed:**
1. ForeverHandler — added an optional arrivalLatch that counts down when
handle() is entered, signaling that a request has arrived and the
connection is occupied.
2. testConnectionPoolTimeout — instead of starting both threads
simultaneously and hoping for the right scheduling, it now:
- Starts thread 1 and waits for the arrivalLatch (proving thread 1 holds
the single connection)
- Only then starts thread 2, which deterministically finds the pool
exhausted and gets the 1ms timeout
- Asserts specifically that thread 2 (not thread 1) got the exception
The existing ForeverHandler usages are unaffected since arrivalLatch
defaults to null.
Co-authored-by: Joe Alphonso <[email protected]>
* Addressed some late comments to the PR
* Enforce the AnnotationWriter role for annotation adds and updates
* Trim the webservices/annotations pom of unused or unnecessary
dependencies
* Replaced `jackson-databind-protobuf` because its response
serialization was inconsistent with request deserialization. The result
is simpler.
Updated table cache to use the update in-memory-accumulo allowing for
synchronous updates to the table cache during reloads. Updated table
cache to provide an isAvailable mechanism to know when tables have been
loaded.
Updated the health mechanism to check table caches in addition to the
connection factory.
Implements a Jackson deserializer that can convert a simple flat JSON object
containing one or more key/value pairs into the JAX-RS MultivaluedMap object
consumed in the Datawave QueryExecutorBean.
Includes a quickstart web test for validating POST with JSON.