tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r398973 - in /tomcat/container/tc5.5.x/modules/groupcom: ./ src/share/org/apache/catalina/tribes/transport/ src/share/org/apache/catalina/tribes/transport/bio/ src/share/org/apache/catalina/tribes/transport/nio/
Date Tue, 02 May 2006 17:37:03 GMT
Author: fhanik
Date: Tue May  2 10:36:53 2006
New Revision: 398973

URL: http://svn.apache.org/viewcvs?rev=398973&view=rev
Log:
Completed the failed ack feature. Its now optional whether it throws the exception or not,
default is not

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/AbstractSender.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioSender.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java
    tomcat/container/tc5.5.x/modules/groupcom/to-do.txt

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/AbstractSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/AbstractSender.java?rev=398973&r1=398972&r2=398973&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/AbstractSender.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/AbstractSender.java
Tue May  2 10:36:53 2006
@@ -57,6 +57,7 @@
     private boolean soLingerOn = true;
     private int soLingerTime = 3;
     private int soTrafficClass = 0x04 | 0x08 | 0x010;
+    private boolean throwOnFailedAck = false;
     public AbstractSender() {
         
     }
@@ -196,6 +197,10 @@
         return soTrafficClass;
     }
 
+    public boolean getThrowOnFailedAck() {
+        return throwOnFailedAck;
+    }
+
     public void setKeepAliveCount(int keepAliveCount) {
         this.keepAliveCount = keepAliveCount;
     }
@@ -258,5 +263,9 @@
 
     public void setSoTrafficClass(int soTrafficClass) {
         this.soTrafficClass = soTrafficClass;
+    }
+
+    public void setThrowOnFailedAck(boolean throwOnFailedAck) {
+        this.throwOnFailedAck = throwOnFailedAck;
     }
 }

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioSender.java?rev=398973&r1=398972&r2=398973&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioSender.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioSender.java
Tue May  2 10:36:53 2006
@@ -19,20 +19,19 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.net.UnknownHostException;
 import java.util.Arrays;
 
 import org.apache.catalina.tribes.Member;
+import org.apache.catalina.tribes.RemoteProcessException;
 import org.apache.catalina.tribes.io.XByteBuffer;
+import org.apache.catalina.tribes.transport.AbstractSender;
 import org.apache.catalina.tribes.transport.Constants;
 import org.apache.catalina.tribes.transport.DataSender;
 import org.apache.catalina.tribes.transport.SenderState;
 import org.apache.catalina.tribes.util.StringManager;
-import org.apache.catalina.tribes.transport.AbstractSender;
-import org.apache.catalina.tribes.RemoteProcessException;
 
 /**
  * Send cluster messages with only one socket. Ack and keep Alive Handling is
@@ -293,7 +292,7 @@
             if (!ackReceived) {
                 if (i == -1) throw new IOException(sm.getString("IDataSender.ack.eof",getAddress(),
new Integer(socket.getLocalPort())));
                 else throw new IOException(sm.getString("IDataSender.ack.wrong",getAddress(),
new Integer(socket.getLocalPort())));
-            } else if ( failAckReceived ) {
+            } else if ( failAckReceived && getThrowOnFailedAck()) {
                 throw new RemoteProcessException("Received a failed ack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA");
             }
         } catch (IOException x) {

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java?rev=398973&r1=398972&r2=398973&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java
Tue May  2 10:36:53 2006
@@ -160,7 +160,7 @@
             byte[] ackcmd = ackbuf.extractDataPackage(true);
             boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
             boolean fack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);
-            if ( fack ) throw new RemoteProcessException("Received a failed ack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA");
+            if ( fack && getThrowOnFailedAck() ) throw new RemoteProcessException("Received
a failed ack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA");
             return ack || fack;
         } else {
             return false;

Modified: tomcat/container/tc5.5.x/modules/groupcom/to-do.txt
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/to-do.txt?rev=398973&r1=398972&r2=398973&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/to-do.txt (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/to-do.txt Tue May  2 10:36:53 2006
@@ -42,10 +42,6 @@
     Add in the ability to start up tribes, but don't start the membership broadcast
     component, only the listener
 
-42. When the option SEND_OPTIONS_SYNCHRONIZED_ACK, and an error happens during
-    processing on the remote node, a FAIL_ACK command should be sent 
-    so that the sending node doesn't have to time out
-
 41. Build a tipi that is a soft membership
 
 38. Make the AbstractReplicatedMap accept non serializable elements, but just don't replicate
them
@@ -252,4 +248,11 @@
 Notes: Completed. The membership now carries a variable length host address to support IPv6
 
 40. channel.stop() - should broadcast a stop message, to avoid timeout
-Notes: Completed. 
\ No newline at end of file
+Notes: Completed. 
+
+42. When the option SEND_OPTIONS_SYNCHRONIZED_ACK, and an error happens during
+    processing on the remote node, a FAIL_ACK command should be sent 
+    so that the sending node doesn't have to time out
+Notes: Completed. The error will be wrapped in a ChannelException and marked as a 
+       RemoteProcessException for that node.
+       To receive this exception, one must turn on 



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


Mime
View raw message