janhoy commented on code in PR #1496:
URL: https://github.com/apache/solr/pull/1496#discussion_r1151763884


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java:
##########
@@ -116,12 +114,23 @@ protected ConcurrentUpdateSolrClient(Builder builder) {
     this.streamDeletes = builder.streamDeletes;
     this.connectionTimeout = Math.toIntExact(builder.connectionTimeoutMillis);
     this.soTimeout = Math.toIntExact(builder.socketTimeoutMillis);
-    this.stallTime = Integer.getInteger("solr.cloud.client.stallTime", 15000);
-    if (stallTime < pollQueueTime * 2) {
+    this.pollQueueTimeMillis = builder.pollQueueTime;
+    this.stallTimeMillis = Integer.getInteger("solr.cloud.client.stallTime", 
15000);
+
+    // make sure the stall time is larger than the polling time
+    // to give a chance for the queue to change
+    int minimalStallTime = pollQueueTimeMillis * 2;
+    if (minimalStallTime > this.stallTimeMillis) {
+      this.stallTimeMillis = minimalStallTime;
+    }
+
+    if (stallTimeMillis < pollQueueTimeMillis * 2) {
       throw new RuntimeException(
-          "Invalid stallTime: " + stallTime + "ms, must be 2x > pollQueueTime 
" + pollQueueTime);
+          "Invalid stallTime: "

Review Comment:
   This condition will never happen, as we now force `this.stallTimeMillis` to 
at least 2x pollQueueTime. So just remove lines 127-133?



-- 
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: issues-unsubscr...@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to