Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-8450: Do not retry admin requests, they are not idempotent.

Mark Robert Miller2789c45a9528
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpRequestRetryHandler.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpRequestRetryHandler.java
index f2ed8ac76a9..1e43c045a41 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpRequestRetryHandler.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpRequestRetryHandler.java
@@ -133,7 +133,7 @@ public class SolrHttpRequestRetryHandler implements HttpRequestRetryHandler {
return true;
}
- log.debug("Do not retry, no rules matched");
+ log.debug("Do not retry, no allow rules matched");
return false;
}
@@ -143,7 +143,11 @@ public class SolrHttpRequestRetryHandler implements HttpRequestRetryHandler {
protected boolean handleAsIdempotent(final HttpClientContext context) {
String method = context.getRequest().getRequestLine().getMethod();
- context.getRequest().getRequestLine().getUri();
+ // do not retry admin requests, even if they are GET as they are not idempotent
+ if (context.getRequest().getRequestLine().getUri().startsWith("/admin/")) {
+ log.debug("Do not retry, this is an admin request");
+ return false;
+ }
return method.equals(GET);
}