[
https://issues.apache.org/jira/browse/HTTPCLIENT-2379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17998270#comment-17998270
]
yhzdys commented on HTTPCLIENT-2379:
------------------------------------
There's also another case that might be overlooked: even if the connection is
still open, if the `reusable` flag is passed as false to the release method,
the connection should not be leased again.
{code:java}
/**
* Releases the pool entry back to the pool.
*
* @param entry pool entry leased from the pool
* @param reusable flag indicating whether or not the released connection is in
a consistent state and is safe for further use.
*/
void release(PoolEntry<T, C> entry, boolean reusable);{code}
> Multiple removal of same PoolEntry causes IllegalStateException in
> H2SharingConnPool
> ------------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-2379
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2379
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient (async)
> Affects Versions: 5.5
> Reporter: yhzdys
> Priority: Major
> Fix For: 5.5.1, 5.6-alpha1
>
> Attachments:
> HTTPCLIENT-2379__release_of_closed___ivalid_pool_entries_by_H2SharingConnPool_can_cause_in.patch
>
> Time Spent: 2h 40m
> Remaining Estimate: 0h
>
> After enabling messageMultiplexing, the H2SharingConnPool is used to reuse
> PoolEntry.
> When making more than one request using the same connection, if the
> connection is closed,
> the pool.release(entry, reusable) method at H2SharingConnPool.java:183 will
> throw the following exception:
> ~~~java
> throw new IllegalStateException("Pool entry is not present in the set of
> leased entries");
> ~~~
> This occurs because the same connection is being removed multiple times.
> https://github.com/yhzdys/httpcomponents-client/commit/c8256b33c3adb45cfa2a49efb2dacfb611da9ac1
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]