[prev in list] [next in list] [prev in thread] [next in thread]
List: httpclient-commons-dev
Subject: [jira] [Updated] (HTTPCLIENT-1081) getMetrics() does not work for HEAD or other early release method
From: "Oleg Kalnichevski (Jira)" <jira () apache ! org>
Date: 2020-09-28 12:37:00
Message-ID: JIRA.12503991.1302563243000.436576.1601296620145 () Atlassian ! JIRA
[Download RAW message or body]
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]
Oleg Kalnichevski updated HTTPCLIENT-1081:
------------------------------------------
Fix Version/s: (was: 5.1-beta1)
5.1
> getMetrics() does not work for HEAD or other early release methods
> ------------------------------------------------------------------
>
> Key: HTTPCLIENT-1081
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1081
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Reporter: Sebb
> Priority: Major
> Fix For: 5.1
>
>
> The following code works fine for GET:
> HttpResponse httpResponse =
> httpClient.execute(httpRequest, localContext);
> HttpConnection conn = (HttpConnection)
> localContext.getAttribute(ExecutionContext.HTTP_CONNECTION);
> HttpConnectionMetrics metrics = conn.getMetrics();
> but fails on the getMetrics() call when the request is HEAD:
> org.apache.http.impl.conn.ConnectionShutdownException
> at org.apache.http.impl.conn.AbstractClientConnAdapter.assertValid(AbstractClientConnAdapter.java:154)
> at org.apache.http.impl.conn.AbstractClientConnAdapter.getMetrics(AbstractClientConnAdapter.java:190)
> This is because the getMetrics() method calls assertValid() which checks that the \
> connection has not been released, and the HEAD request is released as soon as it \
> completes, before returning to the caller. Possible solutions:
> - don't call assertValid() in getMetrics()
> - store a pointer to the metrics in the local context
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic