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 20:28:27 UTC

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

jdeppe-pivotal commented on a change in pull request #6909:
URL: https://github.com/apache/geode/pull/6909#discussion_r717930232



##########
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) {
+        sleepInterval = 2 * PartitionedRegionHelper.DEFAULT_WAIT_PER_RETRY_ITERATION;
+      } else if (count == 10) {
+        sleepInterval = 5 * PartitionedRegionHelper.DEFAULT_WAIT_PER_RETRY_ITERATION;
+      } else if (count == 15) {
+        sleepInterval = 10 * PartitionedRegionHelper.DEFAULT_WAIT_PER_RETRY_ITERATION;
+      }
+    }

Review comment:
       What happens if this loop also times out? If we're timing out without achieving the desired state shouldn't that cause an exception then?
   
   Sorry, I'm not familiar with the original issue at all, but it feels like this may not be addressing an underlying issue.
   




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