Github user wy96f commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2484#discussion_r245252912
--- Diff:
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
---
@@ -278,21 +293,26 @@ public boolean isPaging() {
lock.readLock().lock();
try {
- if (addressFullMessagePolicy == AddressFullMessagePolicy.BLOCK) {
- return false;
- }
- if (addressFullMessagePolicy == AddressFullMessagePolicy.FAIL) {
- return isFull();
- }
- if (addressFullMessagePolicy == AddressFullMessagePolicy.DROP) {
- return isFull();
- }
- return paging;
+ return isPagingDirtyRead();
} finally {
lock.readLock().unlock();
}
}
+ @Override
+ public boolean isPagingDirtyRead() {
+ if (addressFullMessagePolicy == AddressFullMessagePolicy.BLOCK) {
--- End diff --
> Yes, but we can just volatile load once before checking its value 3
times, on each call of isPagingDirtyRead
get it. nice catch :+1:
---