[
https://issues.jboss.org/browse/JBREM-1248?page=com.atlassian.jira.plugin...
]
Ron Sigal commented on JBREM-1248:
----------------------------------
Added configuration option
org.jboss.remoting.transport.http.HTTPClientInvoker.IGNORE_ERROR_RESPONSE_MESSAGE (actual
value "ignoreErrorResponseMessage"). When set to true, either in the
InvokerLocator or the configuration map, HTTPClientInvoker.useHttpURLConnection() will not
try to retrieve the response error message or response code when processing an exception.
The default value is true. That is, the default behavior remains unchanged.
Change applied to branches 2.2 and 2.x
Unit tests: org.jboss.test.remoting.transport.http.IgnoreResponseMessageTestCase.
Waiting for results in hudson.
Avoid connecting to a server in catch clause in case of
HttpClientInvoker connection failure
--------------------------------------------------------------------------------------------
Key: JBREM-1248
URL:
https://issues.jboss.org/browse/JBREM-1248
Project: JBoss Remoting
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: transport
Affects Versions: 2.2.3.SP2, 2.5.3.SP1
Reporter: Toshiya Kobayashi
Assignee: Ron Sigal
Fix For: 2.5.3.SP2, 2.2.3.SP4
Due to a change introduced by JBREM-960 , HttpClientInvoker will try to connect to a
server again by HttpURLConnection#getResponseMessage() in catch clause.
try
{
...
OutputStream stream = conn.getOutputStream();
...
{
catch (Exception e)
{
String message = "Can not connect http client invoker.";
if (e.getMessage() != null)
message += " " + e.getMessage() + ".";
try
{
String responseMessage = conn.getResponseMessage();
int code = conn.getResponseCode();
message += " Response: " + responseMessage + "/" + code +
".";
}
catch (IOException e1)
{
log.debug("Unable to retrieve response message", e1);
}
throw new CannotConnectException(message, e);
}
This second try may succeed depending on server/network condition even if
conn.getOutputStream() in try clause fails.
From a point of view of users (actually, JBossWS user),
- That may consume a connection with an empty body request
- On server side, they can't figure out if the empty request comes from this
behaviour or just an empty request was wrongly/maliciously sent
So the request is going to be
- Avoid connecting to a server in catch clause in case of connection failure
If that's impossible or too tricky to achieve JBREM-960 at a time, then
- Provide a system property switch to skip the
conn.getResponseMessage()/conn.getResponseCode() lines
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira