You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2006/03/07 23:07:15 UTC

svn commit: r384031 - /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/RpcChannel.java

Author: fhanik
Date: Tue Mar  7 14:07:13 2006
New Revision: 384031

URL: http://svn.apache.org/viewcvs?rev=384031&view=rev
Log:
fixed majority receiving, when you want a response from the majority of the members

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/RpcChannel.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/RpcChannel.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/RpcChannel.java?rev=384031&r1=384030&r2=384031&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/RpcChannel.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/RpcChannel.java Tue Mar  7 14:07:13 2006
@@ -102,9 +102,12 @@
                 callback.leftOver(rmsg.message, sender);
             } else {
                 synchronized (collector) {
+                    //make sure it hasn't been removed
                     if ( responseMap.containsKey(key) ) {
                         collector.addResponse(rmsg.message, sender);
                         if (collector.isComplete()) collector.notifyAll();
+                    } else {
+                        callback.leftOver(rmsg.message, sender);
                     }
                 }//synchronized
             }//end if
@@ -222,7 +225,7 @@
                 case MAJORITY_REPLY:
                 {
                     float perc = ((float)responses.size()) / ((float)destcnt);
-                    return perc >= 50f;
+                    return perc >= 0.50f;
                 }
                 case FIRST_REPLY:
                     return responses.size()>0;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org