activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/2] activemq-artemis git commit: ARTEMIS-1280 Avoiding leak on Queue futures
Date Tue, 11 Jul 2017 15:35:47 GMT
ARTEMIS-1280 Avoiding leak on Queue futures


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/82f071ff
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/82f071ff
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/82f071ff

Branch: refs/heads/master
Commit: 82f071ff46ae6e6363cf5ed8a7e58c7d47532766
Parents: eab0cb5
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Tue Jul 11 10:55:04 2017 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Jul 11 11:32:03 2017 -0400

----------------------------------------------------------------------
 .../activemq/artemis/core/server/impl/QueueImpl.java      |  7 -------
 .../tests/timing/core/server/impl/QueueImplTest.java      | 10 ++--------
 2 files changed, 2 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/82f071ff/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
index 82524ff..e903100 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
@@ -88,7 +88,6 @@ import org.apache.activemq.artemis.utils.Env;
 import org.apache.activemq.artemis.utils.FutureLatch;
 import org.apache.activemq.artemis.utils.ReferenceCounter;
 import org.apache.activemq.artemis.utils.ReusableLatch;
-import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet;
 import org.apache.activemq.artemis.utils.collections.LinkedListIterator;
 import org.apache.activemq.artemis.utils.collections.PriorityLinkedList;
 import org.apache.activemq.artemis.utils.collections.PriorityLinkedListImpl;
@@ -206,8 +205,6 @@ public class QueueImpl implements Queue {
 
    private Redistributor redistributor;
 
-   private final Set<ScheduledFuture<?>> futures = new ConcurrentHashSet<>();
-
    private ScheduledFuture<?> redistributorFuture;
 
    private ScheduledFuture<?> checkQueueSizeFuture;
@@ -887,8 +884,6 @@ public class QueueImpl implements Queue {
             DelayedAddRedistributor dar = new DelayedAddRedistributor(executor);
 
             redistributorFuture = scheduledExecutor.schedule(dar, delay, TimeUnit.MILLISECONDS);
-
-            futures.add(redistributorFuture);
          }
       } else {
          internalAddRedistributor(executor);
@@ -900,8 +895,6 @@ public class QueueImpl implements Queue {
       redistributorFuture = null;
       if (future != null) {
          future.cancel(false);
-
-         futures.remove(future);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/82f071ff/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java
b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java
index 121a4b0..ed1a4e5 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java
@@ -135,10 +135,7 @@ public class QueueImplTest extends ActiveMQTestBase {
 
    @Test
    public void testScheduled() throws Exception {
-      QueueImpl queue =
-               new QueueImpl(1, new SimpleString("address1"), new SimpleString("queue1"),
null, null, false, true,
-                             false, scheduledExecutor, null, null, null,
-                             Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory()),
null);
+      QueueImpl queue = new QueueImpl(1, new SimpleString("address1"), new SimpleString("queue1"),
null, null, false, true, false, scheduledExecutor, null, null, null, Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory()),
null);
 
       FakeConsumer consumer = null;
 
@@ -236,10 +233,7 @@ public class QueueImplTest extends ActiveMQTestBase {
          public void disconnect() {
          }
       };
-      QueueImpl queue =
-               new QueueImpl(1, new SimpleString("address1"), QueueImplTest.queue1, null,
null, false, true, false,
-                             scheduledExecutor, null, null, null,
-                             Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory()),
null);
+      QueueImpl queue = new QueueImpl(1, new SimpleString("address1"), QueueImplTest.queue1,
null, null, false, true, false, scheduledExecutor, null, null, null, Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory()),
null);
       MessageReference messageReference = generateReference(queue, 1);
       queue.addConsumer(consumer);
       messageReference.setScheduledDeliveryTime(System.currentTimeMillis() + 2000);


Mime
View raw message