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/09/28 18:16:09 UTC

[GitHub] [geode] mhansonp commented on a change in pull request #6909: GEODE-9642: proposal of solution

mhansonp commented on a change in pull request #6909:
URL: https://github.com/apache/geode/pull/6909#discussion_r717840646



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/CreateMissingBucketsTask.java
##########
@@ -30,6 +31,33 @@ public CreateMissingBucketsTask(PRHARedundancyProvider prhaRedundancyProvider) {
 
   @Override
   public void run2() {
+    PartitionedRegion partitionedRegion = redundancyProvider.getPartitionedRegion();
+    int count = 0;
+    int sleepInterval = PartitionedRegionHelper.DEFAULT_WAIT_PER_RETRY_ITERATION;
+
+    while (!ColocationHelper.isColocationComplete(partitionedRegion) && (count <= 30)) {

Review comment:
       Please rename count to retryCount and make 30 a constant.

##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/CreateMissingBucketsTask.java
##########
@@ -30,6 +31,33 @@ public CreateMissingBucketsTask(PRHARedundancyProvider prhaRedundancyProvider) {
 
   @Override
   public void run2() {
+    PartitionedRegion partitionedRegion = redundancyProvider.getPartitionedRegion();
+    int count = 0;
+    int sleepInterval = PartitionedRegionHelper.DEFAULT_WAIT_PER_RETRY_ITERATION;
+
+    while (!ColocationHelper.isColocationComplete(partitionedRegion) && (count <= 30)) {
+
+      // Didn't time out. Sleep a bit and then continue
+      boolean interrupted = Thread.interrupted();
+      try {
+        Thread.sleep(sleepInterval);
+      } catch (InterruptedException ignore) {
+        interrupted = true;
+      } finally {
+        if (interrupted) {
+          Thread.currentThread().interrupt();
+        }
+      }
+      count++;
+      if (count == 5) {

Review comment:
       these numbers seem arbitrary. Are they? 




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