Github user franz1981 commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2478#discussion_r243843391
  
    --- Diff: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerImpl.java
 ---
    @@ -335,19 +335,25 @@ public void deletePageStore(final SimpleString 
storeName) throws Exception {
        }
     
        /**
    -    * stores is a ConcurrentHashMap, so we don't need to synchronize this 
method
    +    * This method creates a new store if not exist.
         */
        @Override
        public PagingStore getPageStore(final SimpleString storeName) throws 
Exception {
           if (managementAddress != null && 
storeName.startsWith(managementAddress)) {
              return null;
           }
    -      PagingStore store = stores.get(storeName);
     
    -      if (store != null) {
    -         return store;
    +      try {
    --- End diff --
    
    I think that `stores.get` is better that will be used in the fast path as 
it was before: `chm:.get` is completly lock-free, while `chm::computeIfAbsent` 
will lock on segment level ie better to fallback to `chm::computeIfAbsent` only 
if `chm::get` return `null`


---

Reply via email to