Author: kfujino Date: Thu Oct 4 04:55:23 2012 New Revision: 1393913 URL: http://svn.apache.org/viewvc?rev=1393913&view=rev Log: Fix a behavior of TcpPingInterceptor#useThread. Do not start a ping thread when useThread is set to false.
Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-interceptor.xml Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1393913&r1=1393912&r2=1393913&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Oct 4 04:55:23 2012 @@ -127,15 +127,6 @@ PATCHES PROPOSED TO BACKPORT: +1: kkolinko, schultz, markt -1: -* Fix a behavior of TcpPingInterceptor#useThread. - If set to false, ping thread is never started. - kkolinko: Better wording for the above sentence: - "Do not start a ping thread when useThread is set to false." - http://svn.apache.org/viewvc?view=revision&revision=1387073 - http://svn.apache.org/viewvc?view=revision&revision=1387487 - +1: kfujino, kkolinko, schultz, markt - -1: - * Improve session management in CsrfPreventionFilter (Backport of r1393071 from Tomcat 7) http://people.apache.org/~kkolinko/patches/2012-10-03_tc6_CsrfPreventionFilter.patch Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java?rev=1393913&r1=1393912&r2=1393913&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java Thu Oct 4 04:55:23 2012 @@ -63,7 +63,7 @@ public class TcpPingInterceptor extends public synchronized void start(int svc) throws ChannelException { super.start(svc); running = true; - if ( thread == null ) { + if ( thread == null && useThread) { thread = new PingThread(); thread.setDaemon(true); thread.setName("TcpPingInterceptor.PingThread-"+cnt.addAndGet(1)); @@ -84,8 +84,10 @@ public class TcpPingInterceptor extends public void stop(int svc) throws ChannelException { running = false; - if ( thread != null ) thread.interrupt(); - thread = null; + if ( thread != null ) { + thread.interrupt(); + thread = null; + } super.stop(svc); } Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1393913&r1=1393912&r2=1393913&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu Oct 4 04:55:23 2012 @@ -295,7 +295,11 @@ <fix> <bug>53607</bug>: To avoid NPE, set TCP PING data to ChannelMessage. Patch provided by F.Arnoud (kfujino) - </fix> + </fix> + <fix> + Fix a behavior of TcpPingInterceptor#useThread. + Do not start a ping thread when useThread is set to false. (kfujino) + </fix> </changelog> </subsection> <subsection name="Web applications"> Modified: tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-interceptor.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-interceptor.xml?rev=1393913&r1=1393912&r2=1393913&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-interceptor.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/config/cluster-interceptor.xml Thu Oct 4 04:55:23 2012 @@ -55,6 +55,7 @@ <li><code>org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor</code></li> <li><code>org.apache.catalina.tribes.group.interceptors.FragmentationInterceptor</code></li> <li><code>org.apache.catalina.tribes.group.interceptors.GzipInterceptor</code></li> + <li><code>org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor</code></li> </ul> </p> </section> @@ -143,6 +144,20 @@ <attributes> </attributes> </subsection> + <subsection name="org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor Attributes"> + <attributes> + <attribute name="interval" required="false"> + If useThread == true, defines the interval of sending a ping message. + default is 1000 ms. + </attribute> + <attribute name="useThread" required="false"> + Flag of whether to start a thread for sending a ping message. + If set to true, this interceptor will start a local thread for sending a ping message. + if set to false, channel heartbeat will send a ping message. + default is false. + </attribute> + </attributes> + </subsection> <subsection name="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor Attributes"> <attributes> <attribute name="interval" required="false"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org