eclipse-ee4j / eclipse-ee4j/jersey

ApacheConnector's breaks any connecting pool by always forcing all connections to be close and not released back to the pool.

Open
#3,532 9 comments 0 reactions 0 assignees View on GitHub
Component: connectors Priority: Major Type: Bug
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

The PR/change introduced in #3124 causes connection pooling to break.

When response.close()([https://github.com/jersey/jersey/commit/0d1326dee69d9c693014184bea3e4a44b323daee#diff-91ece5335d0cdc9321a099df1caec54fR643](https://github.com/jersey/jersey/commit/0d1326dee69d9c693014184bea3e4a44b323daee#diff-91ece5335d0cdc9321a099df1caec54fR643)) is called this causes Apache HttpClient to not release the connection back to the pool but close it instead.

The flow is:
HttpClientResponseInputStream.close() -> CloseableHttpResponse.close() -> HttpResponseProxy.close() -> ConnectionHolder.close() -> ConnectionHolder.releaseConnection(false)….
releaseConnection(false) causes the underlying connection to be closed and not released back to the pool for reuse.
#### Affected Versions
[2.25.1]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.