This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new f4ba87ea672 SOLR-17819: Disable http2 request cancellation for Jetty 
10 (#3428)
f4ba87ea672 is described below

commit f4ba87ea67237887b161062e26f18c572ab41ca5
Author: Houston Putman <[email protected]>
AuthorDate: Fri Jul 18 13:31:38 2025 -0700

    SOLR-17819: Disable http2 request cancellation for Jetty 10 (#3428)
---
 solr/CHANGES.txt                                   |  2 +
 .../component/DistributedDebugComponentTest.java   | 52 ++++++++++++----------
 .../solr/client/solrj/impl/Http2SolrClient.java    | 14 +++---
 3 files changed, 40 insertions(+), 28 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 135115970ea..a738881f558 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -181,6 +181,8 @@ Bug Fixes
 
 * GITHUB#3426: Improving check in TextToVectorUpdateProcessorFactory, which 
breaks update for new dynamic fields. (Renato Haeberli via Alessandro Benedetti)
 
+* SOLR-17819: Disable http2 request cancellation for Jetty 10, the 
cancellation can bleed across to other requests. (Houston Putman)
+
 Dependency Upgrades
 ---------------------
 * SOLR-17795: Upgrade Lucene to 9.12.2. (Pierre Salagnac, Christine Poerschke, 
Houston Putman)
diff --git 
a/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
 
b/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
index 5027f975c33..7aa5af237aa 100644
--- 
a/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
+++ 
b/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
@@ -409,29 +409,35 @@ public class DistributedDebugComponentTest extends 
SolrJettyTestBase {
     query.set("debug", "true");
     query.set("distrib", "true");
     query.setFields("id", "text");
-    query.set("shards", shard1 + "," + shard2 + "," + badShard);
-
-    // verify that the request would fail if shards.tolerant=false
-    ignoreException("Server refused connection");
-    expectThrows(SolrException.class, () -> collection1.query(query));
-
-    query.set(ShardParams.SHARDS_TOLERANT, "true");
-    QueryResponse response = collection1.query(query);
-    assertTrue(
-        (Boolean)
-            response
-                .getResponseHeader()
-                .get(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY));
-    @SuppressWarnings("unchecked")
-    NamedList<String> badShardTrack =
-        (((NamedList<NamedList<NamedList<String>>>) 
response.getDebugMap().get("track"))
-                .get("EXECUTE_QUERY"))
-            .get(badShard);
-    assertEquals("Unexpected response size for shard", 1, 
badShardTrack.size());
-    Entry<String, String> exception = badShardTrack.iterator().next();
-    assertEquals("Expected key 'Exception' not found", "Exception", 
exception.getKey());
-    assertNotNull("Exception message should not be null", 
exception.getValue());
-    unIgnoreException("Server refused connection");
+    // When the badShard is placed first, we are more likely to hit errors
+    query.set("shards", badShard + "," + shard2 + "," + shard1);
+
+    // Submit the requests enough times to get failures when code is buggy
+    for (int i = 0; i < (TEST_NIGHTLY ? 500 : 200); i++) {
+      // verify that the request would fail if shards.tolerant=false
+      query.set(ShardParams.SHARDS_TOLERANT, "false");
+      ignoreException("Server refused connection");
+      expectThrows(SolrException.class, () -> collection1.query(query));
+
+      // verify that the request would succeed if shards.tolerant=true
+      query.set(ShardParams.SHARDS_TOLERANT, "true");
+      QueryResponse response = collection1.query(query);
+      assertTrue(
+          (Boolean)
+              response
+                  .getResponseHeader()
+                  .get(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY));
+      @SuppressWarnings("unchecked")
+      NamedList<String> badShardTrack =
+          (((NamedList<NamedList<NamedList<String>>>) 
response.getDebugMap().get("track"))
+                  .get("EXECUTE_QUERY"))
+              .get(badShard);
+      assertEquals("Unexpected response size for shard", 1, 
badShardTrack.size());
+      Entry<String, String> exception = badShardTrack.iterator().next();
+      assertEquals("Expected key 'Exception' not found", "Exception", 
exception.getKey());
+      assertNotNull("Exception message should not be null", 
exception.getValue());
+      unIgnoreException("Server refused connection");
+    }
   }
 
   /** Compares the same section on the two query responses */
diff --git 
a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java 
b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
index fcf8705400f..7462798a06a 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
@@ -567,11 +567,15 @@ public class Http2SolrClient extends HttpSolrClientBase {
                     new SolrServerException(failure.getMessage(), failure));
               }
             });
-    future.exceptionally(
-        (error) -> {
-          mrrv.request.abort(error);
-          return null;
-        });
+
+    // SOLR-17819: Disabling request aborting for Solr 9.x (Jetty 10).
+    // Not disabled for Solr 10.x because Jetty 12 does not have the same 
issue.
+    //
+    // future.exceptionally(
+    //     (error) -> {
+    //       mrrv.request.abort(error);
+    //       return null;
+    //     });
 
     if (mrrv.contentWriter != null) {
       try (var output = mrrv.requestContent.getOutputStream()) {

Reply via email to