Skip to content

Commit db0cbd3

Browse files
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.
1 parent 436e7f8 commit db0cbd3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

solr/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ Bug Fixes
182182
current live nodes list is stale. CloudSolrClient now retains the initial configured list of passed URLs as backup
183183
used for fetching cluster state when all live nodes have failed. (Matthew Biscocho via David Smiley, Houston Putman)
184184

185+
* SOLR-17637: LBHttp2SolrClient can fail to complete async requests in certain error scenarios.
186+
This can cause the HttpShardHandler to indefinitely wait on a completed response that will never come. (Houston Putman)
187+
185188
Dependency Upgrades
186189
---------------------
187190
* SOLR-17471: Upgrade Lucene to 9.12.1. (Pierre Salagnac, Christine Poerschke)

solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void onFailure(Exception e, boolean retryReq) {
156156
Endpoint url;
157157
try {
158158
url = it.nextOrError(e);
159-
} catch (SolrServerException ex) {
159+
} catch (Throwable ex) {
160160
apiFuture.completeExceptionally(e);
161161
return;
162162
}

solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ public synchronized Endpoint nextOrError(Exception previousEx) throws SolrServer
315315
}
316316
// Skipping check time exceeded for the first request
317317
// Ugly string based hack but no live servers message here is VERY misleading :(
318-
if ((previousEx != null && previousEx.getMessage().contains("Limits exceeded!"))
318+
if ((previousEx != null
319+
&& previousEx.getMessage() != null
320+
&& previousEx.getMessage().contains("Limits exceeded!"))
319321
|| (numServersTried > 0 && isTimeExceeded(timeAllowedNano, timeOutTime))) {
320322
throw new SolrServerException(
321323
"The processing limits for to this request were exceeded, see cause for details",

0 commit comments

Comments
 (0)