[
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16785093#comment-16785093
]
Jason Gerlowski commented on SOLR-13270:
----------------------------------------
I'm going to assign this to myself and hope to get to this by or over this
weekend. A few questions/notes:
1. If the issue is as simple as us overriding the RequestConfig in
{{executeMethod}} how does the POST manage to get the 100-continue header
through? Is POST not following the same code path, or is it following the same
codepath and 100-continue is coming from somewhere else? Still need to trace
this through...
2. Is pulling the RequestConfig from the HttpClient (if it exists) the right
fix, or is "RequestConfig" an important-enough configuration object that it
should be exposed on the HttpSolrClient.Builder in its own right? Is this an
awful idea in light of us moving away from Apache HttpComponents with the
in-development HTTP2 versions of these clients?
3. How should conflicts between RequestConfig and any other HttpSolrClient
settings interact? Should we overlay the provided RequestConfig settings on
top of our defaults where possible? Which values should win when a user
specifies a RequestConfig but also chooses conflicting
{{SolrClientBuilder.withConnectionTimeout}}/{{SolrClientBuilder.withSocketTimeout}}
values?
(I don't think any of these are huge roadblocks, just leaving notes for myself
on where to pick this up when I return in a few days. If anyone has any
thoughts or insight though....)
> SolrJ does not send "Expect: 100-continue" header
> -------------------------------------------------
>
> Key: SOLR-13270
> URL: https://issues.apache.org/jira/browse/SOLR-13270
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Components: SolrJ
> Affects Versions: 7.7
> Reporter: Erlend Garåsen
> Priority: Major
>
> SolrJ does not set the "Expect: 100-continue" header, even though it's
> configured in HttpClient:
> {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:
> https://issues.apache.org/jira/browse/CONNECTORS-1564
> The problem can be reproduced by building and running the following small
> Maven project:
> [http://folk.uio.no/erlendfg/solr/missing-header.zip]
> 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 = builder.build();
> // 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
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]