Skip to content

Apache Lucene open-source search software

SOLR-4716,SOLR-4584: SolrCloud request proxying does not work on Tomcat and perhaps other non Jetty containers.

Mark Robert Miller40717e3439ff
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index df45d2fb3a8..939a2afd470 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -222,6 +222,9 @@ Bug Fixes
* SOLR-4661: Admin UI Replication details now correctly displays the current
replicable generation/version of the master. (hossman)
+* SOLR-4716,SOLR-4584: SolrCloud request proxying does not work on Tomcat and
+ perhaps other non Jetty containers. (Po Rui, Yago Riveiro via Mark Miller)
+
Optimizations
----------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
index ae8601247c9..e064a3933c4 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
@@ -448,6 +448,7 @@ public class SolrDispatchFilter implements Filter
os = con.getOutputStream(); // side effect: method is switched to POST
try {
IOUtils.copyLarge(is, os);
+ os.flush();
} finally {
IOUtils.closeQuietly(os);
IOUtils.closeQuietly(is); // TODO: I thought we weren't supposed to explicitly close servlet streams
@@ -470,6 +471,7 @@ public class SolrDispatchFilter implements Filter
os = resp.getOutputStream();
try {
IOUtils.copyLarge(is, os);
+ os.flush();
} finally {
IOUtils.closeQuietly(os); // TODO: I thought we weren't supposed to explicitly close servlet streams
IOUtils.closeQuietly(is);