mirror of https://github.com/apache/lucene.git
SOLR-14250: Do not log error when trying to consume non-existing input stream due to Expect: 100-continue (#1250)
This commit is contained in:
parent
f8a2c39906
commit
89b13377a1
|
@ -166,6 +166,8 @@ Bug Fixes
|
|||
* SOLR-12550: ConcurrentUpdateSolrClient doesn't respect timeouts for commits and optimize.
|
||||
(Marc A. Morissette, Bérénice MAUREL via shalin)
|
||||
|
||||
* SOLR-14250: Do not log error when trying to consume non-existing input stream due to Expect: 100-continue (janhoy)
|
||||
|
||||
Other Changes
|
||||
---------------------
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ import io.opentracing.Tracer;
|
|||
import io.opentracing.tag.Tags;
|
||||
import org.apache.commons.io.FileCleaningTracker;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpHeaders;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.lucene.util.Version;
|
||||
import org.apache.solr.api.V2HttpCall;
|
||||
|
@ -442,21 +443,25 @@ public class SolrDispatchFilter extends BaseSolrFilter {
|
|||
if (scope != null) scope.close();
|
||||
|
||||
GlobalTracer.get().clearContext();
|
||||
consumeInputFully(request);
|
||||
consumeInputFully(request, response);
|
||||
}
|
||||
}
|
||||
|
||||
// we make sure we read the full client request so that the client does
|
||||
// not hit a connection reset and we can reuse the
|
||||
// connection - see SOLR-8453 and SOLR-8683
|
||||
private void consumeInputFully(HttpServletRequest req) {
|
||||
private void consumeInputFully(HttpServletRequest req, HttpServletResponse response) {
|
||||
try {
|
||||
ServletInputStream is = req.getInputStream();
|
||||
while (!is.isFinished() && is.read() != -1) {}
|
||||
} catch (IOException e) {
|
||||
if (req.getHeader(HttpHeaders.EXPECT) != null && response.isCommitted()) {
|
||||
log.debug("No input stream to consume from client");
|
||||
} else {
|
||||
log.info("Could not consume full client request", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow a subclass to modify the HttpSolrCall. In particular, subclasses may
|
||||
|
|
Loading…
Reference in New Issue