[jboss-remoting-issues] [JBoss JIRA] Resolved: (JBREM-1248) Avoid connecting to a server in catch clause in case of HttpClientInvoker connection failure
Ron Sigal (JIRA)
jira-events at lists.jboss.org
Mon Dec 27 13:06:18 EST 2010
[ https://issues.jboss.org/browse/JBREM-1248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ron Sigal resolved JBREM-1248.
------------------------------
Resolution: Done
Test is passing 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
More information about the jboss-remoting-issues
mailing list