diff --git a/changelog/unreleased/PR#4490-HttpJettySolrClient-IllegalStateException.yml b/changelog/unreleased/PR#4490-HttpJettySolrClient-IllegalStateException.yml new file mode 100644 index 000000000000..cf5b8961c987 --- /dev/null +++ b/changelog/unreleased/PR#4490-HttpJettySolrClient-IllegalStateException.yml @@ -0,0 +1,9 @@ +title: > + HttpJettySolrClient could throw IllegalStateException on connection lost, + which foiled LBSolrClient's attempts to classify a request as retry-able. +type: fixed +authors: + - name: David Smiley +links: + - name: PR#4490 + url: https://github.com/apache/solr/pull/4490 diff --git a/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java b/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java index fdd5fa8443b9..46f0a23aec67 100644 --- a/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java +++ b/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java @@ -507,6 +507,10 @@ public NamedList request(SolrRequest solrRequest, String collection) "IOException occurred when talking to server at: " + url, cause); } throw new SolrServerException(cause.getMessage(), cause); + } catch (IllegalStateException e) { + // Jetty HTTP/2 throws IllegalStateException ("session closed") when the connection is lost. + abortCause = e; + throw new SolrServerException("Connection lost at: " + url, new IOException(e)); } catch (SolrServerException | RuntimeException sse) { abortCause = sse; throw sse;