[jboss-cvs] JBossAS SVN: r111974 - branches/JBPAPP_5_1/cluster/src/main/org/jboss/invocation/unified/interfaces.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 9 17:31:47 EDT 2011


Author: dereed
Date: 2011-08-09 17:31:47 -0400 (Tue, 09 Aug 2011)
New Revision: 111974

Modified:
   branches/JBPAPP_5_1/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java
Log:
[JBPAPP-6899] Fix NPE from race condition when a server goes down


Modified: branches/JBPAPP_5_1/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java
===================================================================
--- branches/JBPAPP_5_1/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java	2011-08-09 21:26:26 UTC (rev 111973)
+++ branches/JBPAPP_5_1/cluster/src/main/org/jboss/invocation/unified/interfaces/UnifiedInvokerHAProxy.java	2011-08-09 21:31:47 UTC (rev 111974)
@@ -163,6 +163,9 @@
       Object target = loadBalancePolicy.chooseTarget(familyClusterInfo, invocationBasedRouting);
       InvokerLocator targetLocator = (InvokerLocator) target;
 
+      if ( targetLocator == null )
+         return null;
+
       // check if load balancer pick the client invoker we already have
       if(!getLocator().equals(targetLocator))
       {
@@ -205,6 +208,10 @@
 
             Client clientInstance = getClient(invocation);
 
+            // JBPAPP-6899 All targets were removed since the last check in while(...)
+            if ( clientInstance == null )
+               continue;
+
             if (trace)
             {
                log.trace("Making invocation on " + clientInstance.getInvoker().getLocator());
@@ -527,4 +534,4 @@
       }
       return (tpcFactory == null) ? null : tpcFactory.getTransactionPropagationContext();
    }
-}
\ No newline at end of file
+}



More information about the jboss-cvs-commits mailing list