HoustonPutman commented on code in PR #4046:
URL: https://github.com/apache/solr/pull/4046#discussion_r2692504148


##########
solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java:
##########
@@ -421,22 +420,28 @@ protected static CoreStatusResponse.SingleCoreData 
getCoreStatus(Replica replica
   }
 
   protected CollectionAdminRequest.RequestStatusResponse 
waitForAsyncClusterRequest(
-      String asyncId, Duration timeout)
-      throws SolrServerException, IOException, InterruptedException {
-    CollectionAdminRequest.RequestStatus requestStatus =
+      String asyncId, Duration timeout) throws InterruptedException {
+    final CollectionAdminRequest.RequestStatus requestStatus =
         CollectionAdminRequest.requestStatus(asyncId);
-    CollectionAdminRequest.RequestStatusResponse rsp = null;
-    TimeOut timeoutCheck = new TimeOut(timeout, TimeSource.NANO_TIME);
-    while (!timeoutCheck.hasTimedOut()) {
-      rsp = requestStatus.process(cluster.getSolrClient());
-      if (rsp.getRequestStatus() == RequestStatusState.FAILED
-          || rsp.getRequestStatus() == RequestStatusState.COMPLETED) {
-        return rsp;
-      }
-      Thread.sleep(50);
-    }
-    fail("Async request " + asyncId + " did not complete within duration: " + 
timeout.toString());
-    return rsp;
+    final AtomicReference<CollectionAdminRequest.RequestStatusResponse> rsp =

Review Comment:
   Yeah, agreed.
   
   Ok at first I was going to just revert the change. But then I decided adding 
an additional retry utility that would return a response, that is validated, 
would be better. The method looks MUCH better now.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to