You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/02/25 14:54:08 UTC

[GitHub] [activemq-artemis] jbertram commented on a change in pull request #2992: ARTEMIS-2629 ensure queue auto-delete after expiration

jbertram commented on a change in pull request #2992: ARTEMIS-2629 ensure queue auto-delete after expiration
URL: https://github.com/apache/activemq-artemis/pull/2992#discussion_r383928613
 
 

 ##########
 File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueManagerImpl.java
 ##########
 @@ -84,8 +84,7 @@ public static boolean messageCountCheck(Queue queue) {
    }
 
    public static boolean delayCheck(Queue queue) {
-      long consumerRemovedTimestamp =  queue.getConsumerRemovedTimestamp();
-      return consumerRemovedTimestamp != -1 && System.currentTimeMillis() - consumerRemovedTimestamp >= queue.getAutoDeleteDelay();
+      return System.currentTimeMillis() - queue.getConsumerRemovedTimestamp() >= queue.getAutoDeleteDelay();
 
 Review comment:
   It *will* change the semantic, and that was intended. This particular check is no longer desirable as it will preclude auto-deleting a queue where all the messages have expired but no consumer has ever connected. I implemented a new check in `org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl.AddressQueueReaper#queueWasUsed` which resolves this issue. The `delayCheck` method is only used internally as it's not part of the user-facing API so I don't have any qualms with changing its semantics.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services