8000 Thread Pinning With Virtual Threads · Issue #1985 · aws/aws-encryption-sdk-java · GitHub
[go: up one dir, main page]

Skip to content
Thread Pinning With Virtual Threads #1985
Closed
@bcluap

Description

@bcluap

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0