agingade commented on a change in pull request #5014: URL: https://github.com/apache/geode/pull/5014#discussion_r418364658
########## File path: geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java ########## @@ -1086,6 +1088,35 @@ public static GemFireCacheImpl getForPdx(String reason) { clientMetadataService = clientMetadataServiceFactory.apply(this); } + @Override + public void lockDiskStore(String diskStoreName) { + CountDownLatch countDownLatch = diskStoreLatches.get(diskStoreName); Review comment: Is get() required, when using putIfAbsent()? putIfAbsent will return either null or old value. ########## File path: geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java ########## @@ -521,12 +521,12 @@ void create(InternalCache cache) cache.initializePdxRegistry(); - for (DiskStore diskStore : diskStores.values()) { + diskStores.values().parallelStream().forEach(diskStore -> { DiskStoreAttributesCreation creation = (DiskStoreAttributesCreation) diskStore; if (creation != pdxRegDSC) { createDiskStore(creation, cache); } - } + }); Review comment: How is the exception handled? ########## File path: geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreFactoryImpl.java ########## @@ -141,10 +141,9 @@ DiskStoreImpl createOwnedByRegion(String name, boolean isOwnedByPR, @Override public DiskStore create(String name) { this.attrs.name = name; - // As a simple fix for 41290, only allow one DiskStore to be created - // at a time per cache by syncing on the cache. DiskStore result; - synchronized (this.cache) { + try { Review comment: Based on the previous comment for 41290; it seems there was a need to create disk-store one at a time. From the comment its not clear, if its when the disk-stores are created through java API or cache xml (ClusterConfig). Why do we need to change the synchronization...Here the disk-stores are just added into the map and reading from the disk happens in the CacheCreation.java. ########## File path: geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java ########## @@ -521,12 +521,12 @@ void create(InternalCache cache) cache.initializePdxRegistry(); - for (DiskStore diskStore : diskStores.values()) { + diskStores.values().parallelStream().forEach(diskStore -> { DiskStoreAttributesCreation creation = (DiskStoreAttributesCreation) diskStore; if (creation != pdxRegDSC) { createDiskStore(creation, cache); } - } + }); Review comment: Need to add unit/integration tests for both cases, with multiple and single thread trying to create disk-stores. ---------------------------------------------------------------- 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: us...@infra.apache.org