Github user franz1981 commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2484#discussion_r245048241
--- 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 --
we can read it just once and save it in a local variable, avoiding 3
volatile loads: same can be done on the original version too
---