sigram commented on code in PR #2461: URL: https://github.com/apache/solr/pull/2461#discussion_r1602919046
########## solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java: ########## @@ -566,24 +576,28 @@ public NamedList<Object> request(final SolrRequest<?> request, String collection if (!success) { // stall prevention int currentQueueSize = queue.size(); + long currentTime = System.nanoTime(); + long processed = processedCount.sum(); if (currentQueueSize != lastQueueSize) { // there's still some progress in processing the queue - not stalled lastQueueSize = currentQueueSize; + lastProcessedCount = processed; + lastCheckTime = currentTime; lastStallTime = -1; } else { - if (lastStallTime == -1) { - // mark a stall but keep trying - lastStallTime = System.nanoTime(); - } else { - long currentStallTime = - TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - lastStallTime); - if (currentStallTime > stallTimeMillis) { + long timeElapsed = TimeUnit.NANOSECONDS.toMillis(currentTime - lastCheckTime); + if (timeElapsed > stallTimeMillis) { Review Comment: Please note that the same logic is present in 3 places - request(), blockUntilFinished() and waitForEmptyQueue(). Also, we're supposed to use `ConcurrentUpdateHttp2SolrClient` 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: 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