Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14250

Solr tries to read request body after error response is sent

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 8.5
    • None
    • None

    Description

      If a client sends a HTTP POST request with header Expect: 100-continue the normal flow is for Solr (Jetty) to first respond with a HTTP 100 continue response, then the client will send the body which will be processed and then a final response is sent by Solr.

      However, if such a request leads to an error (e.g. 404 or 401), then Solr will skip the 100 response and instead send the error response directly. The very last ation of SolrDispatchFilter#doFilter is to call consumeInputFully(). However, this should not be done in case an error response has already been sent, else you'll provoke an exception in Jetty's HTTP lib:

      2020-02-07 23:13:26.459 INFO  (qtp403547747-24) [   ] o.a.s.s.SolrDispatchFilter Could not consume full client request => java.io.IOException: Committed before 100 Continues
      	at org.eclipse.jetty.http2.server.HttpChannelOverHTTP2.continue100(HttpChannelOverHTTP2.java:362)
      java.io.IOException: Committed before 100 Continues
      	at org.eclipse.jetty.http2.server.HttpChannelOverHTTP2.continue100(HttpChannelOverHTTP2.java:362) ~[http2-server-9.4.19.v20190610.jar:9.4.19.v20190610]
      	at org.eclipse.jetty.server.Request.getInputStream(Request.java:872) ~[jetty-server-9.4.19.v20190610.jar:9.4.19.v20190610]
      	at javax.servlet.ServletRequestWrapper.getInputStream(ServletRequestWrapper.java:185) ~[javax.servlet-api-3.1.0.jar:3.1.0]
      	at org.apache.solr.servlet.SolrDispatchFilter$1.getInputStream(SolrDispatchFilter.java:612) ~[solr-core-8.4.1.jar:8.4.1 832bf13dd9187095831caf69783179d41059d013 - ishan - 2020-01-10 13:40:28]
      	at org.apache.solr.servlet.SolrDispatchFilter.consumeInputFully(SolrDispatchFilter.java:454) ~[solr-core-8.4.1.jar:8.4.1 832bf13dd9187095831caf69783179d41059d013 - ishan - 2020-01-10 13:40:28]
      	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:445) ~[solr-core-8.4.1.jar:8.4.1 832bf13dd9187095831caf69783179d41059d013 - ishan - 2020-01-10 13:40:28]
      

       

      Attachments

        Issue Links

          Activity

            People

              janhoy Jan Høydahl
              janhoy Jan Høydahl
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h