[jboss-remoting-commits] JBoss Remoting SVN: r5472 - remoting2/branches/2.2/src/main/org/jboss/remoting/transport/socket.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Mon Sep 14 14:54:46 EDT 2009


Author: ron.sigal at jboss.com
Date: 2009-09-14 14:54:46 -0400 (Mon, 14 Sep 2009)
New Revision: 5472

Modified:
   remoting2/branches/2.2/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
Log:
JBREM-1152: Assures that last getConnection() failure with SocketException throws CannotConnectException.

Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java	2009-09-14 16:19:38 UTC (rev 5471)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java	2009-09-14 18:54:46 UTC (rev 5472)
@@ -602,17 +602,25 @@
          }
          catch (SocketException e)
          {
+            semaphore.release();
+            if (trace) log.trace(this + " released semaphore: " + semaphore.permits());
             log.debug(this + " got " + e + ": " + e.getMessage());
-            semaphore.release();
-            continue;
+            if (retryCount < numberOfCallRetries - 1)
+            {
+               continue;
+            }
+            throw new CannotConnectException(
+                  "Can not get connection to server. Problem establishing " +
+                  "socket connection for " + locator, e);
+            
          }
          catch (IOException e)
-         {
+         {  
             semaphore.release();
             if (trace) log.trace(this + " released semaphore: " + semaphore.permits());
-            if (isGeneralizeSocketException() && RETRIABLE_ERROR_MESSAGE.matcher(e.getMessage()).matches())
+            log.debug(this + " got " + e + ": " + e.getMessage());
+            if (retryCount < numberOfCallRetries - 1 && isGeneralizeSocketException() && RETRIABLE_ERROR_MESSAGE.matcher(e.getMessage()).matches())
             {
-               log.debug(this + " got " + e + ": " + e.getMessage());
                continue;
             }
             throw new CannotConnectException(



More information about the jboss-remoting-commits mailing list