Uploaded image for project: 'JBoss Remoting'
  1. JBoss Remoting
  2. JBREM-1248

Avoid connecting to a server in catch clause in case of HttpClientInvoker connection failure

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.2.3.SP2, 2.5.3.SP1
    • Fix Version/s: 2.5.4, 2.2.4
    • Component/s: transport
    • Labels:
      None

      Description

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ron_sigal Ron Sigal
                  Reporter:
                  tkobayashi Toshiya Kobayashi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: