[ 
https://issues.apache.org/jira/browse/HTTPCORE-634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147715#comment-17147715
 ] 

Daniel Jelinski commented on HTTPCORE-634:
------------------------------------------

[~olegk] sure, here goes:
{noformat}
java.lang.IllegalStateException: Entry 
[id:2][route:{s}->https://issues.apache.org:443][state:null] has not been 
leased from this pool
        at org.apache.http.util.Asserts.check(Asserts.java:46)
        at 
org.apache.http.pool.RouteSpecificPool.free(RouteSpecificPool.java:118)
        at 
org.apache.http.pool.AbstractConnPool.release(AbstractConnPool.java:410)
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.releaseConnection(PoolingHttpClientConnectionManager.java:347)
        at 
org.apache.http.impl.execchain.ConnectionHolder.releaseConnection(ConnectionHolder.java:110)
        at 
org.apache.http.impl.execchain.ConnectionHolder.close(ConnectionHolder.java:156)
        at 
org.apache.http.impl.execchain.HttpResponseProxy.close(HttpResponseProxy.java:62)
        at 
com.compuware.apm.collector.communication.CollectorStressTest$1HttpClientThead.run(CollectorStressTest.java:183)
        at java.base/java.lang.Thread.run(Thread.java:834) {noformat}


> IllegalStateException: Entry [] has not been leased from this pool
> ------------------------------------------------------------------
>
>                 Key: HTTPCORE-634
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-634
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>    Affects Versions: 4.4.11
>            Reporter: Daniel Jelinski
>            Priority: Major
>
> We are sporadically observing the exception mentioned in summary; while 
> searching the Internet, I found [this SO page 
> |https://stackoverflow.com/questions/46188047/httpclient-4-5-x-multithread-request-error-has-not-been-leased-from-this-pool]
>  providing a semi-reliable reproducer. Minified form follows:
> {code:java}
> public static void main(String[] args) {
>    final PoolingHttpClientConnectionManager cm = new 
> PoolingHttpClientConnectionManager();
>    cm.setDefaultMaxPerRoute(1);
>    class HttpClientThead implements Runnable {
>       final String reqString;
>       final CloseableHttpClient httpclient1 = HttpClients.custom()
>             .setConnectionManager(cm)
>             .build();
>       HttpClientThead(String reqString) {
>          this.reqString = reqString;
>       }
>       public void run() {
>          for (int i = 1; i <= 10; i++) {
>             HttpClientContext context = HttpClientContext.create();
>             try {
>                HttpGet httpget = new HttpGet(reqString);
>                CloseableHttpResponse response = httpclient1.execute(httpget, 
> context);
>                response.close();
>             } catch (Throwable e) {
>                e.printStackTrace();
>                System.exit(1);
>             } finally {
>                cm.closeExpiredConnections();
>             }
>          }
>       }
>    }
>    HttpClientThead t1 = new HttpClientThead("https://issues.apache.org/";);
>    Thread thread1 = new Thread(t1);
>    thread1.start();
>    t1.run();
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to