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:
[email protected]
With regards,
Apache Git Services