You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/10/25 21:35:28 UTC

[GitHub] [geode] kirklund commented on a change in pull request #7035: GEODE-9768: wait for destroying of region to finish, before creating …

kirklund commented on a change in pull request #7035:
URL: https://github.com/apache/geode/pull/7035#discussion_r735984826



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
##########
@@ -489,7 +489,21 @@ public void addShadowPartitionedRegionForUserPR(PartitionedRegion userPR,
       boolean isAccessor = (userPR.getLocalMaxMemory() == 0);
 
       final String prQName = sender.getId() + QSTRING + convertPathToName(userPR.getFullPath());
-      prQ = (PartitionedRegion) cache.getRegion(prQName);
+
+      prQ = (PartitionedRegion) cache.getRegion(prQName, true);
+      if (prQ != null && prQ.isDestroyed()) {
+        PartitionedRegion oldPrQ = prQ;
+        while (oldPrQ == prQ) {
+          try {
+            Thread.sleep(50);
+          } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+          }
+          logger.info("wait for destroy to finish");
+
+          prQ = (PartitionedRegion) cache.getRegion(prQName, true);
+        }

Review comment:
       I think this block needs some unit test coverage in addition to the dunit tests.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org