]
Ron Sigal updated JBREM-1248:
-----------------------------
Issue Type: Enhancement (was: Feature Request)
Changed from Feature Request to Enhancement.
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: Enhancement
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: