You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by az...@apache.org on 2008/10/25 20:06:12 UTC

svn commit: r707878 - /webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java

Author: azeez
Date: Sat Oct 25 11:06:11 2008
New Revision: 707878

URL: http://svn.apache.org/viewvc?rev=707878&view=rev
Log:
Handling situation where two simultaneously starting nodes may try to get initialization info from each other

Modified:
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java?rev=707878&r1=707877&r2=707878&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java (original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java Sat Oct 25 11:06:11 2008
@@ -530,23 +530,25 @@
             try {
                 if (!sentMembersList.contains(memberHost)) {
                     Response[] responses;
-                    do {
-                        responses = rpcInitChannel.send(new Member[]{member},
-                                                        command,
-                                                        RpcChannel.FIRST_REPLY,
-                                                        Channel.SEND_OPTIONS_ASYNCHRONOUS,
-                                                        10000);
-                        if (responses.length == 0) {
-                            try {
-                                Thread.sleep(500);
-                            } catch (InterruptedException ignored) {
-                            }
+//                    do {
+                    responses = rpcInitChannel.send(new Member[]{member},
+                                                    command,
+                                                    RpcChannel.FIRST_REPLY,
+                                                    Channel.SEND_OPTIONS_ASYNCHRONOUS,
+                                                    10000);
+                    if (responses.length == 0) {
+                        try {
+                            Thread.sleep(500);
+                        } catch (InterruptedException ignored) {
                         }
-                        // TODO: If we do not get a response within some time, try to recover from this fault
                     }
-                    while (responses.length == 0 || responses[0] == null || responses[0].getMessage() == null);
-                    ((ControlCommand) responses[0].getMessage()).execute(configurationContext); // Do the initialization
-                    break;
+                    // TODO: If we do not get a response within some time, try to recover from this fault
+//                    }
+//                    while (responses.length == 0 || responses[0] == null || responses[0].getMessage() == null);    // TODO: #### We will need to check this 
+                    if (responses.length != 0 && responses[0] != null && responses[0].getMessage() != null) {
+                        ((ControlCommand) responses[0].getMessage()).execute(configurationContext); // Do the initialization
+                        break;
+                    }
                 }
             } catch (Exception e) {
                 log.error("Cannot get initialization information from " +