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

Philip Helger commented on HTTPCLIENT-2314:
-------------------------------------------

[~olegk] I added some more debug logging and stumbled upon an interesting this.

Is it normal, that "connect" is called twice on a request?

{{[2024-01-05T18:22:48,126] [PP] [INFO ] [ajp-nio-0:0:0:0:0:0:0:1-8110-exec-1] 
HttpClientConnectionManager[10005].lease(ex-0000000001, 
{}->http://B-7401c65872f60ab7963e121ec802c6a0.iso6523-actorid-upis.edelivery.tech.ec.europa.eu:80,
 5 SECONDS, null) -- 
com.helger.httpclient.HttpClientFactory$1.lease(HttpClientFactory.java:279)}}
{{[2024-01-05T18:22:48,142] [PP] [INFO ] [ajp-nio-0:0:0:0:0:0:0:1-8110-exec-1] 
HttpClientConnectionManager[10005].connect(org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint@3409d85b,
 null, \{http.cookie-store=[], 
http.request-config=[expectContinueEnabled=false, proxy=null, 
cookieSpec=strict, redirectsEnabled=true, maxRedirects=50, 
circularRedirectsAllowed=false, authenticationEnabled=true, 
targetPreferredAuthSchemes=null, proxyPreferredAuthSchemes=null, 
connectionRequestTimeout=5 SECONDS, connectTimeout=null, responseTimeout=10 
SECONDS, connectionKeepAlive=3 MINUTES, contentCompressionEnabled=true, 
hardCancellationEnabled=true], 
http.cookiespec-registry={relaxed=org.apache.hc.client5.http.impl.cookie.RFC6265CookieSpecFactory@7a415d75,
 
ignore=org.apache.hc.client5.http.impl.cookie.IgnoreCookieSpecFactory@2c5e8a52, 
strict=org.apache.hc.client5.http.impl.cookie.RFC6265CookieSpecFactory@334c0675},
 
http.auth.exchanges=\{http://B-7401c65872f60ab7963e121ec802c6a0.iso6523-actorid-upis.edelivery.tech.ec.europa.eu:80=[UNCHALLENGED]},
 http.auth.credentials-provider=[], 
http.authscheme-registry=\{digest=org.apache.hc.client5.http.impl.auth.DigestSchemeFactory@49fdcb47,
 bearer=org.apache.hc.client5.http.impl.auth.BearerSchemeFactory@39279df8, 
basic=org.apache.hc.client5.http.impl.auth.BasicSchemeFactory@61738c94}, 
http.protocol.redirect-locations=org.apache.hc.client5.http.protocol.RedirectLocations@325f5161,
 http.exchange-id=ex-0000000001}) -- 
com.helger.httpclient.HttpClientFactory$1.connect(HttpClientFactory.java:293)}}
{{[2024-01-05T18:22:48,311] [PP] [INFO ] [ajp-nio-0:0:0:0:0:0:0:1-8110-exec-1] 
HttpClientConnectionManager[10005].connect(org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint@3409d85b,
 null, \{http.request=GET 
http://B-7401c65872f60ab7963e121ec802c6a0.iso6523-actorid-upis.edelivery.tech.ec.europa.eu/iso6523-actorid-upis%3A%3A0192%3A987447702,
 http.request-config=[expectContinueEnabled=false, proxy=null, 
cookieSpec=strict, redirectsEnabled=true, maxRedirects=50, 
circularRedirectsAllowed=false, authenticationEnabled=true, 
targetPreferredAuthSchemes=null, proxyPreferredAuthSchemes=null, 
connectionRequestTimeout=5 SECONDS, connectTimeout=null, responseTimeout=10 
SECONDS, connectionKeepAlive=3 MINUTES, contentCompressionEnabled=true, 
hardCancellationEnabled=true], http.auth.credentials-provider=[], 
http.protocol.redirect-locations=org.apache.hc.client5.http.protocol.RedirectLocations@325f5161,
 http.cookie-spec=rfc6265-strict, http.exchange-id=ex-0000000001, 
http.cookie-store=[], 
http.cookiespec-registry={relaxed=org.apache.hc.client5.http.impl.cookie.RFC6265CookieSpecFactory@7a415d75,
 
ignore=org.apache.hc.client5.http.impl.cookie.IgnoreCookieSpecFactory@2c5e8a52, 
strict=org.apache.hc.client5.http.impl.cookie.RFC6265CookieSpecFactory@334c0675},
 
http.auth.exchanges=\{http://B-7401c65872f60ab7963e121ec802c6a0.iso6523-actorid-upis.edelivery.tech.ec.europa.eu:80=[UNCHALLENGED]},
 
http.route={}->http://B-7401c65872f60ab7963e121ec802c6a0.iso6523-actorid-upis.edelivery.tech.ec.europa.eu:80,
 
http.cookie-origin=[b-7401c65872f60ab7963e121ec802c6a0.iso6523-actorid-upis.edelivery.tech.ec.europa.eu:80/iso6523-actorid-upis%3A%3A0192%3A987447702],
 
http.authscheme-registry=\{digest=org.apache.hc.client5.http.impl.auth.DigestSchemeFactory@49fdcb47,
 bearer=org.apache.hc.client5.http.impl.auth.BearerSchemeFactory@39279df8, 
basic=org.apache.hc.client5.http.impl.auth.BasicSchemeFactory@61738c94}}) -- 
com.helger.httpclient.HttpClientFactory$1.connect(HttpClientFactory.java:293)}}
{{[2024-01-05T18:22:48,316] [PP] [INFO ] [ajp-nio-0:0:0:0:0:0:0:1-8110-exec-1] 
HttpClientConnectionManager[10005].release(org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint@3409d85b,
 null, 0 MILLISECONDS) -- 
com.helger.httpclient.HttpClientFactory$1.release(HttpClientFactory.java:285)}}
{{[2024-01-05T18:22:48,316] [PP] [INFO ] [ajp-nio-0:0:0:0:0:0:0:1-8110-exec-1] 
After HTTP call: GET. No response -- 
com.helger.httpclient.HttpDebugger.afterRequest(HttpDebugger.java:94)}}
{{java.lang.IllegalStateException: Endpoint is not connected}}

I am trying to find the callstacks when this happens....

> IllegalStateException: Endpoint is not connected
> ------------------------------------------------
>
>                 Key: HTTPCLIENT-2314
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2314
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 5.2, 5.3
>            Reporter: Philip Helger
>            Priority: Major
>         Attachments: debuglog-httpclient-2314.txt
>
>
> Using `PoolingHttpClientConnectionManager`, under high traffic situations it 
> occurs consistently that the exception "Endpoint is not connected" is invoked.
>  
> The full stacktrace looks like this:
> {{Caused by: java.lang.IllegalStateException: Endpoint is not connected}}
> {{    at org.apache.hc.core5.util.Asserts.check(Asserts.java:38) 
> ~[httpcore5-5.2.4.jar:5.2.4]}}
> {{    at 
> org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint.getValidatedPoolEntry(PoolingHttpClientConnectionManager.java:664)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint.setSocketTimeout(PoolingHttpClientConnectionManager.java:697)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.InternalExecRuntime.execute(InternalExecRuntime.java:211)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.MainClientExec.execute(MainClientExec.java:116)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:188)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:116)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:245)
>  ~[httpclient5-5.3.jar:5.3]}}
> {{    at 
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:188)
>  ~[httpclient5-5.3.jar:5.3]}}
>  
> Unfortunately I don't have a standalone example to reproduce it.
> Any suggestions for a workaround????



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to