lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erlend Garåsen (JIRA) <>
Subject [jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header
Date Fri, 03 May 2019 08:16:00 GMT


Erlend Garåsen commented on SOLR-13270:

The patch failed with the version of Solr compatible with our environment, so it will take
some extra time to test this out. We're not able to just install Solr 8 on our servers right
away, but I'll try to run Solr and ManifoldCF locally without SSL/basic auth. I can also try
to implement the changes or overwrite the modified SolrJ classes for our Solr 7 environment
to double-check your patch — just to be sure. I will get back to this next week, or perhaps
later today if I manage to complete the tests before the weekend starts.

Thanks for your patch and help, it's really appreciated! Your approach seems reasonable, so
I think this is the right way to go.

> SolrJ does not send "Expect: 100-continue" header
> -------------------------------------------------
>                 Key: SOLR-13270
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: SolrJ
>    Affects Versions: 7.7
>            Reporter: Erlend Garåsen
>            Assignee: Jason Gerlowski
>            Priority: Major
>         Attachments: SOLR-13270.patch
> SolrJ does not set the "Expect: 100-continue" header, even though it's configured in
> {code:java}
> builder.setDefaultRequestConfig(RequestConfig.custom().setExpectContinueEnabled(true).build());{code}
> A HttpClient developer has reviewed the code and says we're setting up
>  the client correctly, so we have a reason to believe there is a bug in
>  SolrJ. It's actually a problem we are facing in ManifoldCF, explained in:
> The problem can be reproduced by building and running the following small Maven project:
> []
> The application runs SolrJ code where the header does not show up and HttpClient code
where the header is present.
> {code:java}
> HttpClientBuilder builder = HttpClients.custom();
> // This should add an Expect: 100-continue header:
> builder.setDefaultRequestConfig(RequestConfig.custom().setExpectContinueEnabled(true).build());
> HttpClient httpClient =;
> // Start Solr and create a core named "test".
> String baseUrl = "http://localhost:8983/solr/test";
> // Test using SolrJ — no expect 100 header
> HttpSolrClient client = new HttpSolrClient.Builder()
>   .withHttpClient(httpClient)
>   .withBaseSolrUrl(baseUrl).build();
> SolrQuery query = new SolrQuery();
> query.setQuery("*:*");
> client.query(query);
> // Test using HttpClient directly — expect 100 header shows up:
> HttpPost httpPost = new HttpPost(baseUrl);
> HttpEntity entity = new InputStreamEntity(new ByteArrayInputStream("test".getBytes()));
> httpPost.setEntity(entity);
> httpClient.execute(httpPost);
> {code}
> When using the last HttpClient test, the expect 100 header appears in missing-header.log:
> {noformat}
> http-outgoing-1 >> Expect: 100-continue{noformat}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message