Skip to content

Apache Lucene open-source search software

SOLR-10170: ClassCastException in RecoveryStrategy.

markrmiller8c1e67e30e07
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 3ccb2ce74e8..cc3a3b238e0 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -167,6 +167,8 @@ Bug Fixes
* SOLR-10168: ShardSplit can fail with NPE in OverseerCollectionMessageHandler#waitForCoreAdminAsyncCallToComplete. (Mark Miller)
+* SOLR-10170: ClassCastException in RecoveryStrategy. (Mark Miller)
+
Optimizations
----------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
index 02b7cbd8e66..62d877b0b00 100644
--- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
+++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
@@ -591,10 +591,12 @@ public class RecoveryStrategy extends Thread implements Closeable {
sendPrepRecoveryCmd(leaderBaseUrl, prepCmd);
break;
} catch (ExecutionException e) {
- SolrServerException solrException = (SolrServerException) e.getCause();
- if (solrException.getRootCause() instanceof SocketTimeoutException && numTries < maxTries) {
- LOG.warn("Socket timeout when send prep recovery cmd, retrying.. ");
- continue;
+ if (e.getCause() instanceof SolrServerException) {
+ SolrServerException solrException = (SolrServerException) e.getCause();
+ if (solrException.getRootCause() instanceof SocketTimeoutException && numTries < maxTries) {
+ LOG.warn("Socket timeout on send prep recovery cmd, retrying.. ");
+ continue;
+ }
}
throw e;
}