3 new revisions:

Revision: fb12795a776b
Author:   [email protected] < <[email protected]>
Date:     Thu Jun 27 13:47:38 2013
Log:      Fixes issue 22
http://code.google.com/p/commscale/source/detail?r=fb12795a776b&repo=load-balancer

Revision: a6efe46f52d9
Author:   [email protected] < <[email protected]>
Date:     Fri Jun 28 01:13:35 2013
Log:      Fixes issue 23
http://code.google.com/p/commscale/source/detail?r=a6efe46f52d9&repo=load-balancer

Revision: 579bda693897
Author:   [email protected] < <[email protected]>
Date:     Fri Jun 28 01:14:10 2013
Log:      Fixes issue 24
http://code.google.com/p/commscale/source/detail?r=579bda693897&repo=load-balancer

==============================================================================
Revision: fb12795a776b
Author:   [email protected] < <[email protected]>
Date:     Thu Jun 27 13:47:38 2013
Log:      Fixes issue 22
http://code.google.com/p/commscale/source/detail?r=fb12795a776b&repo=load-balancer

Modified:
 /jar/pom.xml

=======================================
--- /jar/pom.xml        Mon Apr 22 05:50:26 2013
+++ /jar/pom.xml        Thu Jun 27 13:47:38 2013
@@ -29,7 +29,7 @@
                <dependency>
                        <groupId>io.netty</groupId>
                        <artifactId>netty</artifactId>
-                       <version>3.6.5.Final</version>
+                       <version>3.6.6.Final</version>
                        <!--scope>provided</scope -->
                </dependency>
                <!-- clustering deps -->

==============================================================================
Revision: a6efe46f52d9
Author:   [email protected] < <[email protected]>
Date:     Fri Jun 28 01:13:35 2013
Log:      Fixes issue 23
http://code.google.com/p/commscale/source/detail?r=a6efe46f52d9&repo=load-balancer

Modified:
/jar/src/main/java/org/mobicents/tools/http/balancer/HttpBalancerForwarder.java

=======================================
--- /jar/src/main/java/org/mobicents/tools/http/balancer/HttpBalancerForwarder.java Mon Apr 8 04:52:20 2013 +++ /jar/src/main/java/org/mobicents/tools/http/balancer/HttpBalancerForwarder.java Fri Jun 28 01:13:35 2013
@@ -25,32 +25,35 @@
 import java.net.InetSocketAddress;
 import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.Executor;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+
 import org.apache.log4j.Logger;
-
 import org.jboss.netty.bootstrap.ClientBootstrap;
 import org.jboss.netty.bootstrap.ServerBootstrap;
 import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.group.ChannelGroup;
 import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
 import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
-import org.mobicents.tools.sip.balancer.BalancerContext;
 import org.mobicents.tools.sip.balancer.BalancerRunner;

 public class HttpBalancerForwarder {
private static final Logger logger = Logger.getLogger(HttpBalancerForwarder.class.getCanonicalName());
-       ExecutorService executor;
+       ExecutorService executorServerBoss;
+       ExecutorService executorServerWorkers;
+       ExecutorService executorClientBoss;
+       ExecutorService executorClientWorkers;
        public BalancerRunner balancerRunner;
        NioServerSocketChannelFactory nioServerSocketChannelFactory = null;
        NioClientSocketChannelFactory nioClientSocketChannelFactory = null;
        Channel serverChannel;

        public void start() {
-               executor = Executors.newCachedThreadPool();
- nioServerSocketChannelFactory = new NioServerSocketChannelFactory(executor, executor); - nioClientSocketChannelFactory = new NioClientSocketChannelFactory(executor, executor);
+               executorServerBoss = Executors.newCachedThreadPool();
+               executorServerWorkers = Executors.newCachedThreadPool();
+               executorClientBoss = Executors.newCachedThreadPool();
+               executorClientWorkers = Executors.newCachedThreadPool();
+ nioServerSocketChannelFactory = new NioServerSocketChannelFactory(executorServerBoss, executorServerWorkers); + nioClientSocketChannelFactory = new NioClientSocketChannelFactory(executorClientBoss, executorClientWorkers); HttpChannelAssociations.serverBootstrap = new ServerBootstrap(nioServerSocketChannelFactory); HttpChannelAssociations.inboundBootstrap = new ClientBootstrap(nioClientSocketChannelFactory); HttpChannelAssociations.channels = new ConcurrentHashMap<Channel, Channel>();
@@ -68,7 +71,7 @@
        }

        public void stop() {
-               if(executor == null) return; // already stopped
+//             if(executorServerBoss == null) return; // already stopped
for (Entry<Channel, Channel> entry : HttpChannelAssociations.channels.entrySet()) {
                        entry.getKey().unbind();
                        entry.getKey().close();
@@ -84,14 +87,32 @@
                // http://code.google.com/p/commscale/issues/detail?id=6
                // Hang the VM on shutdown if HTTP Requests has been handled
                // so commented out
-               //              
nioServerSocketChannelFactory.releaseExternalResources();
-               //              
nioClientSocketChannelFactory.releaseExternalResources();
+                               
nioServerSocketChannelFactory.releaseExternalResources();
+                               
nioClientSocketChannelFactory.releaseExternalResources();
+
+                               
HttpChannelAssociations.serverBootstrap.releaseExternalResources();
+                               
HttpChannelAssociations.inboundBootstrap.releaseExternalResources();

-               //              
HttpChannelAssociations.serverBootstrap.releaseExternalResources();
-               //              
HttpChannelAssociations.inboundBootstrap.releaseExternalResources();
+//             nioServerSocketChannelFactory.releaseExternalResources();
+//             nioClientSocketChannelFactory.releaseExternalResources();
+
+               if (executorServerBoss != null){
+                       executorServerBoss.shutdownNow();
+                       executorServerBoss = null;
+               }
+               if (executorServerWorkers != null){
+                       executorServerWorkers.shutdown();
+                       executorServerWorkers = null;
+               }
+               if (executorClientBoss != null){
+                       executorClientBoss.shutdown();
+                       executorClientBoss = null;
+               }
+               if (executorClientWorkers != null){
+                       executorClientWorkers.shutdown();
+                       executorClientWorkers = null;
+               }

-               executor.shutdownNow();
-               executor = null;

                //              System.gc();
        }

==============================================================================
Revision: 579bda693897
Author:   [email protected] < <[email protected]>
Date:     Fri Jun 28 01:14:10 2013
Log:      Fixes issue 24
http://code.google.com/p/commscale/source/detail?r=579bda693897&repo=load-balancer

Modified:
 /jar/src/main/java/org/mobicents/tools/sip/balancer/UDPPacketForwarder.java

=======================================
--- /jar/src/main/java/org/mobicents/tools/sip/balancer/UDPPacketForwarder.java Mon May 13 01:33:31 2013 +++ /jar/src/main/java/org/mobicents/tools/sip/balancer/UDPPacketForwarder.java Fri Jun 28 01:14:10 2013
@@ -108,10 +108,11 @@
                running = false;
                try {
                        worker.interrupt();
-                       if(fromSocket.isConnected())
-                               fromSocket.disconnect();
-                       if(!fromSocket.isClosed())
+//                     if(fromSocket.isConnected())
+//                             fromSocket.disconnect();
+//                     if(!fromSocket.isClosed())
                                fromSocket.close();
+                               fromSocket = null;
                } catch (Exception e) {
                        //e.printStackTrace();
                }

--

--- You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to