mirror of https://github.com/apache/lucene.git
SOLR-8669: Non binary responses use chunked encoding because we flush the outputstream early.
This commit is contained in:
parent
44b58ee4f8
commit
13dda5debb
|
@ -188,6 +188,9 @@ Optimizations
|
|||
* SOLR-8532: Optimize GraphQuery when maxDepth is set by not collecting edges at the maxDepth level.
|
||||
(Kevin Watters via yonik)
|
||||
|
||||
* SOLR-8669: Non binary responses use chunked encoding because we flush the outputstream early.
|
||||
(Mark Miller)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
@ -533,7 +536,7 @@ Bug Fixes
|
|||
|
||||
* SOLR-8578: Successful or not, requests are not always fully consumed by Solrj clients and we
|
||||
count on HttpClient or the JVM. (Mark Miller)
|
||||
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
|
||||
|
@ -544,6 +547,9 @@ Optimizations
|
|||
|
||||
* SOLR-7281: Add an overseer action to publish an entire node as 'down'. (Mark Miller, shalin)
|
||||
|
||||
* SOLR-8669: Non binary responses use chunked encoding because we flush the outputstream early.
|
||||
(Mark Miller)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -48,7 +48,20 @@ public final class QueryResponseWriterUtil {
|
|||
BinaryQueryResponseWriter binWriter = (BinaryQueryResponseWriter) responseWriter;
|
||||
binWriter.write(outputStream, solrRequest, solrResponse);
|
||||
} else {
|
||||
Writer writer = buildWriter(outputStream, ContentStreamBase.getCharsetFromContentType(contentType));
|
||||
OutputStream out = new OutputStream() {
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
outputStream.write(b);
|
||||
}
|
||||
@Override
|
||||
public void flush() throws IOException {
|
||||
// We don't flush here, which allows us to flush below
|
||||
// and only flush internal buffers, not the response.
|
||||
// If we flush the response early, we trigger chunked encoding.
|
||||
// See SOLR-8669.
|
||||
}
|
||||
};
|
||||
Writer writer = buildWriter(out, ContentStreamBase.getCharsetFromContentType(contentType));
|
||||
responseWriter.write(writer, solrRequest, solrResponse);
|
||||
writer.flush();
|
||||
}
|
||||
|
|
|
@ -580,7 +580,6 @@ public class HttpSolrCall {
|
|||
OutputStream os = resp.getOutputStream();
|
||||
|
||||
IOUtils.copyLarge(is, os);
|
||||
os.flush();
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue