[ 
https://issues.apache.org/jira/browse/ARTEMIS-2629?focusedWorklogId=392606&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-392606
 ]

ASF GitHub Bot logged work on ARTEMIS-2629:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Feb/20 14:54
            Start Date: 25/Feb/20 14:54
    Worklog Time Spent: 10m 
      Work Description: jbertram commented on 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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 392606)
    Time Spent: 1h  (was: 50m)

> Queue never auto-deleted after last message expires
> ---------------------------------------------------
>
>                 Key: ARTEMIS-2629
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2629
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to