Description
Problem:
There is thread pinning when using the AWS Encryption SDK as it uses an old Apache HTTP client which causes pinning here:
org.apache.http.pool.AbstractConnPool$2.get(AbstractConnPool.java:256) <== monitors:1
The source:
@Override public E get(final long timeout, final TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException { for (;;) { **synchronized (this) {** try { final E entry = entryRef.get(); if (entry != null) { return entry; } if (done.get()) { throw new ExecutionException(operationAborted()); } final E leasedEntry = getPoolEntryBlocking(route, state, timeout, timeUnit, this); if (validateAfterInactivity > 0) { if (leasedEntry.getUpdated() + validateAfterInactivity <= System.currentTimeMillis()) { if (!validate(leasedEntry)) { leasedEntry.close(); release(leasedEntry, false); continue; } } }
Solution:
The Encryption SDK should allow overirding the HTTP client via an SPI or similar much like many of the other AWS SDK's. Alternatively upgrade to use httpclient5