This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 973ef46fa0f SOLR-17637: Fix LBHttpSolrClient & HttpShardHandler bug 
(#3147)
973ef46fa0f is described below

commit 973ef46fa0f6e48b2d2204ffcaeee9dbb6053d41
Author: Houston Putman <[email protected]>
AuthorDate: Thu Jan 30 13:46:06 2025 -0600

    SOLR-17637: Fix LBHttpSolrClient & HttpShardHandler bug (#3147)
    
    This bug causes async requests to be uncompleted in some error scenarios.
    The HttpShardHandler can hang indefinitely when this happens.
    
    (cherry picked from commit db0cbd38d512da22e99fbbb0e4f65fc720de5441)
---
 solr/CHANGES.txt                                                      | 3 +++
 .../src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java | 2 +-
 .../src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java      | 4 +++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e0147ab0182..e68b39f19e0 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -43,6 +43,9 @@ Bug Fixes
   current live nodes list is stale. CloudSolrClient now retains the initial 
configured list of passed URLs as backup
   used for fetching cluster state when all live nodes have failed. (Matthew 
Biscocho via David Smiley, Houston Putman)
 
+* SOLR-17637: LBHttp2SolrClient can fail to complete async requests in certain 
error scenarios.
+  This can cause the HttpShardHandler to indefinitely wait on a completed 
response that will never come. (Houston Putman)
+
 Dependency Upgrades
 ---------------------
 * SOLR-17471: Upgrade Lucene to 9.12.1. (Pierre Salagnac, Christine Poerschke)
diff --git 
a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java 
b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java
index 15ee0a229d6..14b869fd41a 100644
--- 
a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java
+++ 
b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java
@@ -236,7 +236,7 @@ public class LBHttp2SolrClient extends LBSolrClient {
               String url;
               try {
                 url = it.nextOrError(e);
-              } catch (SolrServerException ex) {
+              } catch (Throwable ex) {
                 apiFuture.completeExceptionally(e);
                 return;
               }
diff --git 
a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java 
b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java
index 172dfd5ab04..921e41358e3 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java
@@ -303,7 +303,9 @@ public abstract class LBSolrClient extends SolrClient {
       }
       // Skipping check time exceeded for the first request
       // Ugly string based hack but no live servers message here is VERY 
misleading :(
-      if ((previousEx != null && previousEx.getMessage().contains("Limits 
exceeded!"))
+      if ((previousEx != null
+              && previousEx.getMessage() != null
+              && previousEx.getMessage().contains("Limits exceeded!"))
           || (numServersTried > 0 && isTimeExceeded(timeAllowedNano, 
timeOutTime))) {
         throw new SolrServerException(
             "The processing limits for to this request were exceeded, see 
cause for details",

Reply via email to