Skip to content

Commit fc1d3e1

Browse files
committed
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 db0cbd3)
1 parent 7af2ad5 commit fc1d3e1

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

solr/CHANGES.txt

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,15 @@ Most people will find the solr-upgrade-notes.adoc file more approachable.
55
https://github.com/apache/solr/blob/main/solr/solr-ref-guide/modules/upgrade-notes/pages/solr-upgrade-notes.adoc
66

77
================== 9.8.1 ==================
8-
New Features
9-
---------------------
10-
(No changes)
11-
12-
Improvements
13-
---------------------
14-
(No changes)
15-
16-
Optimizations
17-
---------------------
18-
(No changes)
19-
208
Bug Fixes
219
---------------------
22-
(No changes)
10+
* SOLR-17637: LBHttp2SolrClient can fail to complete async requests in certain error scenarios.
11+
This can cause the HttpShardHandler to indefinitely wait on a completed response that will never come. (Houston Putman)
2312

2413
Dependency Upgrades
2514
---------------------
2615
(No changes)
2716

28-
Other Changes
29-
---------------------
30-
(No changes)
31-
3217
================== 9.8.0 ==================
3318
New Features
3419
---------------------

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
@@ -236,7 +236,7 @@ public void onFailure(Exception e, boolean retryReq) {
236236
String url;
237237
try {
238238
url = it.nextOrError(e);
239-
} catch (SolrServerException ex) {
239+
} catch (Throwable ex) {
240240
apiFuture.completeExceptionally(e);
241241
return;
242242
}

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
@@ -303,7 +303,9 @@ public synchronized String nextOrError(Exception previousEx) throws SolrServerEx
303303
}
304304
// Skipping check time exceeded for the first request
305305
// Ugly string based hack but no live servers message here is VERY misleading :(
306-
if ((previousEx != null && previousEx.getMessage().contains("Limits exceeded!"))
306+
if ((previousEx != null
307+
&& previousEx.getMessage() != null
308+
&& previousEx.getMessage().contains("Limits exceeded!"))
307309
|| (numServersTried > 0 && isTimeExceeded(timeAllowedNano, timeOutTime))) {
308310
throw new SolrServerException(
309311
"The processing limits for to this request were exceeded, see cause for details",

0 commit comments

Comments
 (0)