Skip to content

HTTP Connection pool lock leak in multithread environment #1657

@barintom

Description

@barintom

Describe the bug?

We are experiencing a problem where temporary SSL/TLS handshake failures trigger a lock leak in Apache HttpClient’s connection pool (it is bug in HTTPCLIENT-2399 -> https://issues.apache.org/jira/browse/HTTPCLIENT-2399). When an SSL error occurs during connection creation/closing, the pool lock may not be released. After that, other threads entering the pool simply wait for a connection that never becomes available, even though the pool should have free capacity.

This makes the connection pool unusable until the application is restarted. A single SSL handshake failure is enough to cause the issue.

What is expected to happen?

With SSL issues

What is the actual behavior?

Thread cannot get connection from pool even when it's full.

Reproduction Steps?

Use connection with SSL setup not trusted by called

Additional Information?

This is known bug and requires to bump HTTPClient to 5.5.1

Java Version

JDK-21

SDK Version

Any

OS version

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions