You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2019/06/21 19:01:44 UTC

[activemq-artemis] branch master updated (d1edb8d -> f964f95)

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git.


    from d1edb8d  ARTEMIS-2338 Adding Wait clauses on QuorumFailOverLiveVotesTest
     new 3b82cad  ARTEMIS-2391 static address may be auto-deleted
     new 1534a8f  Fix JDK version for Travis
     new f964f95  This closes #2724

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .travis.yml                                        |  2 +
 .../core/postoffice/impl/PostOfficeImpl.java       |  6 +--
 .../server/AddressQueueDeleteDelayTest.java        | 50 ++++++++++++++++++++++
 3 files changed, 55 insertions(+), 3 deletions(-)


[activemq-artemis] 02/03: Fix JDK version for Travis

Posted by cl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 1534a8fb83cc47489d86c5d5e9382e35b1cc5ed5
Author: Justin Bertram <jb...@apache.org>
AuthorDate: Thu Jun 20 13:51:06 2019 -0500

    Fix JDK version for Travis
---
 .travis.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 2c7f5fb..6839d8c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,8 @@
 sudo: false
 language: java
 install: true
+jdk:
+  - openjdk8
 
 # clean out Artemis artifacts from the cache
 before_install:


[activemq-artemis] 01/03: ARTEMIS-2391 static address may be auto-deleted

Posted by cl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 3b82cad0245b03e773d5de9c253feb66b0be2238
Author: Justin Bertram <jb...@apache.org>
AuthorDate: Thu Jun 20 13:39:45 2019 -0500

    ARTEMIS-2391 static address may be auto-deleted
---
 .../core/postoffice/impl/PostOfficeImpl.java       |  6 +--
 .../server/AddressQueueDeleteDelayTest.java        | 50 ++++++++++++++++++++++
 2 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
index 1bcff22..c7559be 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
@@ -1512,7 +1512,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
       return true;
    }
 
-  /**
+   /**
     * The expiry scanner can't be started until the whole server has been started other wise you may get races
     */
    @Override
@@ -1601,10 +1601,10 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
             AddressSettings settings = addressSettingsRepository.getMatch(address.toString());
 
             try {
-               if (addressInfo != null && !isAddressBound(address) && addressInfo.getBindingRemovedTimestamp() != -1 && (System.currentTimeMillis() - addressInfo.getBindingRemovedTimestamp() >= settings.getAutoDeleteAddressesDelay())) {
+               if (settings.isAutoDeleteAddresses() && addressInfo != null && addressInfo.isAutoCreated() && !isAddressBound(address) && addressInfo.getBindingRemovedTimestamp() != -1 && (System.currentTimeMillis() - addressInfo.getBindingRemovedTimestamp() >= settings.getAutoDeleteAddressesDelay())) {
 
                   if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
-                     ActiveMQServerLogger.LOGGER.info("deleting auto-created address \"" + address + ".\"");
+                     ActiveMQServerLogger.LOGGER.debug("deleting auto-created address \"" + address + ".\"");
                   }
 
                   server.removeAddressInfo(address, null);
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java
index 27ee6eb..0932482 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java
@@ -163,6 +163,56 @@ public class AddressQueueDeleteDelayTest extends ActiveMQTestBase {
       assertTrue(Wait.waitFor(() -> server.getAddressInfo(address) == null, DURATION_MILLIS, SLEEP_MILLIS));
    }
 
+   @Test
+   public void testAddressDeleteDelay() throws Exception {
+      SimpleString address = RandomUtil.randomSimpleString();
+      SimpleString queue = RandomUtil.randomSimpleString();
+      final long deleteAddressesDelay = 500;
+
+      AddressSettings addressSettings = new AddressSettings().setAutoDeleteAddressesDelay(deleteAddressesDelay);
+      server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings);
+
+      session.createAddress(address, RoutingType.MULTICAST, true);
+      session.createQueue(address, RoutingType.MULTICAST, queue);
+      session.deleteQueue(queue);
+
+      assertTrue(Wait.waitFor(() -> server.getAddressInfo(address) == null, DURATION_MILLIS, SLEEP_MILLIS));
+   }
+
+   @Test
+   public void testAddressDeleteDelayNegative() throws Exception {
+      SimpleString address = RandomUtil.randomSimpleString();
+      SimpleString queue = RandomUtil.randomSimpleString();
+      final long deleteAddressesDelay = 500;
+
+      AddressSettings addressSettings = new AddressSettings().setAutoDeleteAddressesDelay(deleteAddressesDelay);
+      server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings);
+
+      // the address should not be deleted since it is not auto-created
+      session.createAddress(address, RoutingType.MULTICAST, false);
+      session.createQueue(address, RoutingType.MULTICAST, queue);
+      session.deleteQueue(queue);
+
+      assertFalse(Wait.waitFor(() -> server.getAddressInfo(address) == null, DURATION_MILLIS, SLEEP_MILLIS));
+   }
+
+   @Test
+   public void testAddressDeleteDelayNegative2() throws Exception {
+      SimpleString address = RandomUtil.randomSimpleString();
+      SimpleString queue = RandomUtil.randomSimpleString();
+      final long deleteAddressesDelay = 500;
+
+      // the address should not be deleted since autoDeleteAddresses = false
+      AddressSettings addressSettings = new AddressSettings().setAutoDeleteAddressesDelay(deleteAddressesDelay).setAutoDeleteAddresses(false);
+      server.getAddressSettingsRepository().addMatch(address.toString(), addressSettings);
+
+      session.createAddress(address, RoutingType.MULTICAST, true);
+      session.createQueue(address, RoutingType.MULTICAST, queue);
+      session.deleteQueue(queue);
+
+      assertFalse(Wait.waitFor(() -> server.getAddressInfo(address) == null, DURATION_MILLIS, SLEEP_MILLIS));
+   }
+
    @Override
    @Before
    public void setUp() throws Exception {


[activemq-artemis] 03/03: This closes #2724

Posted by cl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit f964f955fa8a877d2f15d4665dadbfb0be96442a
Merge: d1edb8d 1534a8f
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Fri Jun 21 15:01:37 2019 -0400

    This closes #2724

 .travis.yml                                        |  2 +
 .../core/postoffice/impl/PostOfficeImpl.java       |  6 +--
 .../server/AddressQueueDeleteDelayTest.java        | 50 ++++++++++++++++++++++
 3 files changed, 55 insertions(+), 3 deletions(-)