tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1843879 - in /tomcat/trunk: java/org/apache/catalina/tribes/membership/ webapps/docs/
Date Mon, 15 Oct 2018 07:21:27 GMT
Author: kfujino
Date: Mon Oct 15 07:21:26 2018
New Revision: 1843879

URL: http://svn.apache.org/viewvc?rev=1843879&view=rev
Log:
Move the event notification ThreadPoolExecutor to MembershipProviderBase.

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
    tomcat/trunk/java/org/apache/catalina/tribes/membership/MembershipProviderBase.java
    tomcat/trunk/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java?rev=1843879&r1=1843878&r2=1843879&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java Mon Oct
15 07:21:26 2018
@@ -26,8 +26,6 @@ import java.net.InetSocketAddress;
 import java.net.MulticastSocket;
 import java.net.SocketTimeoutException;
 import java.util.Arrays;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.catalina.tribes.Channel;
@@ -36,7 +34,6 @@ import org.apache.catalina.tribes.Member
 import org.apache.catalina.tribes.MessageListener;
 import org.apache.catalina.tribes.io.ChannelData;
 import org.apache.catalina.tribes.io.XByteBuffer;
-import org.apache.catalina.tribes.util.ExecutorFactory;
 import org.apache.catalina.tribes.util.StringManager;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -142,12 +139,6 @@ public class McastServiceImpl extends Me
     protected boolean recoveryEnabled = true;
 
     /**
-     * Dont interrupt the sender/receiver thread, but pass off to an executor
-     */
-    protected final ExecutorService executor =
-            ExecutorFactory.newThreadPool(0, 2, 2, TimeUnit.SECONDS);
-
-    /**
      * disable/enable local loopback message
      */
     protected final boolean localLoopbackDisabled;
@@ -329,6 +320,7 @@ public class McastServiceImpl extends Me
         startLevel = (startLevel & (~level));
         //we're shutting down, send a shutdown message and close the socket
         if ( startLevel == 0 ) {
+            executor.shutdownNow();
             //send a stop message
             member.setCommand(Member.SHUTDOWN_PAYLOAD);
             send(false);

Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/MembershipProviderBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/MembershipProviderBase.java?rev=1843879&r1=1843878&r2=1843879&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/membership/MembershipProviderBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/membership/MembershipProviderBase.java Mon
Oct 15 07:21:26 2018
@@ -18,17 +18,22 @@
 package org.apache.catalina.tribes.membership;
 
 import java.util.Properties;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.catalina.tribes.Member;
 import org.apache.catalina.tribes.MembershipListener;
 import org.apache.catalina.tribes.MembershipProvider;
 import org.apache.catalina.tribes.MembershipService;
+import org.apache.catalina.tribes.util.ExecutorFactory;
 
 public abstract class MembershipProviderBase implements MembershipProvider {
 
     protected Membership membership;
     protected MembershipListener membershipListener;
     protected MembershipService service;
+    // The event notification executor
+    protected final ExecutorService executor = ExecutorFactory.newThreadPool(0, 10, 10, TimeUnit.SECONDS);
 
     @Override
     public void init(Properties properties) throws Exception {

Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java?rev=1843879&r1=1843878&r2=1843879&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/membership/StaticMembershipProvider.java
Mon Oct 15 07:21:26 2018
@@ -25,8 +25,6 @@ import java.nio.charset.StandardCharsets
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.TimeUnit;
 
 import org.apache.catalina.tribes.Channel;
 import org.apache.catalina.tribes.ChannelException;
@@ -39,7 +37,6 @@ import org.apache.catalina.tribes.group.
 import org.apache.catalina.tribes.group.RpcChannel;
 import org.apache.catalina.tribes.util.Arrays;
 import org.apache.catalina.tribes.util.ExceptionUtils;
-import org.apache.catalina.tribes.util.ExecutorFactory;
 import org.apache.catalina.tribes.util.StringManager;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -64,8 +61,6 @@ public class StaticMembershipProvider ex
     protected long pingInterval = 1000;
     protected volatile boolean running = true;
     protected PingThread thread = null;
-    // The event notification executor
-    protected final ExecutorService executor = ExecutorFactory.newThreadPool(0, 10, 10, TimeUnit.SECONDS);
 
     @Override
     public void init(Properties properties) throws Exception {

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1843879&r1=1843878&r2=1843879&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Oct 15 07:21:26 2018
@@ -210,6 +210,10 @@
         Experimental Kubernetes aware cloud membership provider, based on code
         by Maxime Beck. Contains code derived from jgroups. (remm/kfujino)
       </add>
+      <fix>
+        Move the event notification <code>ThreadPoolExecutor</code> to
+        <code>MembershipProviderBase</code>. (kfujino)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">



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


Mime
View raw message