[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-05-21 Thread JIRA


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16844922#comment-16844922
 ] 

Erlend Garåsen commented on SOLR-13270:
---

[~gerlowskija], I'm sorry for the delay.

I still cannot see any expect continue header, so I'm posting my current 
configuration. I also added a security.json file in Solr home and configured 
basic auth configuration in case that had to be done for the header to show up, 
but with no luck. I will later try to change ManifoldCF's solrj.jar with the 
one I have built and test. But here's my sample code.

 
{code:java}
HttpClientBuilder builder = HttpClients.custom();
builder.setDefaultRequestConfig(RequestConfig.custom().setExpectContinueEnabled(true).build());

AuthScope scope = new AuthScope("localhost", 8983, null);
Credentials creds = new UsernamePasswordCredentials("solr", "SolrRocks");
BasicCredentialsProvider cp = new BasicCredentialsProvider();
cp.setCredentials(scope, creds);
builder.setDefaultCredentialsProvider(cp);
try {

  String baseUrl = "http://localhost:8983/solr/test;;
  HttpSolrClient client = new HttpSolrClient.Builder()
    .withHttpClient(httpClient)
    .useRequestConfigFromExternalHttpClient(true)
    .withBaseSolrUrl(baseUrl).build();

  SolrQuery query = new SolrQuery();
  query.setQuery("*:*");
  client.query(query);
  […]
{code}
 

 
{noformat}
DEBUG 21.05.2019 16:45:12:986 (Wire.java:wire:73) - http-outgoing-0 >> "GET 
/solr/test/select?q=*%3A*=javabin=2 HTTP/1.1[\r][\n]"
DEBUG 21.05.2019 16:45:12:987 (Wire.java:wire:73) - http-outgoing-0 >> 
"User-Agent: Solr[org.apache.solr.client.solrj.impl.HttpSolrClient] 1.0[\r][\n]"
DEBUG 21.05.2019 16:45:12:987 (Wire.java:wire:73) - http-outgoing-0 >> "Host: 
localhost:8983[\r][\n]"
DEBUG 21.05.2019 16:45:12:988 (Wire.java:wire:73) - http-outgoing-0 >> 
"Connection: Keep-Alive[\r][\n]"
DEBUG 21.05.2019 16:45:12:988 (Wire.java:wire:73) - http-outgoing-0 >> 
"Accept-Encoding: gzip,deflate[\r][\n]"
DEBUG 21.05.2019 16:45:12:988 (Wire.java:wire:73) - http-outgoing-0 >> 
"[\r][\n]"{noformat}

> 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
>Assignee: Jason Gerlowski
>Priority: Major
> Attachments: SOLR-13270.patch
>
>
> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-05-03 Thread JIRA


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16832488#comment-16832488
 ] 

Erlend Garåsen commented on SOLR-13270:
---

If I get time, I'll do that. Right now I'm struggling with building Solr as 
posted to the list for 20 minutes ago. Ivy it's not able to download 
"io.dropwizard.metrics#metrics-bom;4.0.5" for some reason.

> 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
>Assignee: Jason Gerlowski
>Priority: Major
> Attachments: SOLR-13270.patch
>
>
> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-05-03 Thread JIRA


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16832356#comment-16832356
 ] 

Jan Høydahl commented on SOLR-13270:


If you care to back-port the fix to branch_7_7 it may make it into the upcoming 
7.7.2 release starting next week. It would be excellent with an in-the-field 
validation of the path of course!

> 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
>Assignee: Jason Gerlowski
>Priority: Major
> Attachments: SOLR-13270.patch
>
>
> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-05-03 Thread JIRA


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16832334#comment-16832334
 ] 

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: 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
>Assignee: Jason Gerlowski
>Priority: Major
> Attachments: SOLR-13270.patch
>
>
> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-05-02 Thread JIRA


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16831490#comment-16831490
 ] 

Erlend Garåsen commented on SOLR-13270:
---

[~gerlowskija], sorry for not following up. I'll test your patch within a week. 
:)

> 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
>Assignee: Jason Gerlowski
>Priority: Major
> Attachments: SOLR-13270.patch
>
>
> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-04-12 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16816338#comment-16816338
 ] 

Jason Gerlowski commented on SOLR-13270:


Spent some more time testing the attached patch, and I'm still not confident 
it's working the way we hoped.  I debugged things through SolrJ and verified 
that with the patch the custom RequestConfig does _not_ get overridden by the 
default RequestConfig.  The custom RequestConfig makes it into HttpClient-land. 
 Which is good.  But I'm still not seeing an "Expect" header from the request.  
I spent a bit of time tracing it through the HttpComponent code last night, but 
couldn't find anywhere that uses RequestConfig's "expect" getter.  Surely I'm 
just missing it, but I'm not sure how to proceed without help from someone with 
more HttpComponent know-how.

[~erlendfg] can you double check me, and verify whether the patch fixes the 
problem for you?

> 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
>Assignee: Jason Gerlowski
>Priority: Major
> Attachments: SOLR-13270.patch
>
>
> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-04-07 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16811918#comment-16811918
 ] 

Jason Gerlowski commented on SOLR-13270:


Thinking about this again this morning.  I think there's a few snags that 
weren't apparent at first.

As best as I can tell, _all_ HttpClient's have a RequestConfig object that they 
fall back to as a default.  That is, even if the user doesn't explicitly 
specify one when creating the HttpClient, the client still has a RequestConfig. 
 So we can't do the simple solution here of "always using the RequestConfig on 
the client, if it exists".  Further complicating things, HttpClient doesn't 
provide any accessor for getting at the RequestConfig.  So even if we knew a 
user wanted to use the RequestConfig attached to a given HttpClient, we 
couldn't do anything fancy like calling {{RequestConfig.copy}} and tweaking 
particular settings.

(I'm not an expert on HttpComponent stuff.  Happy to take correction if 
anything above is wrong.)

We do still have a few options though.  The best one probably is to add a 
setter on our SolrClientBuilders that controls whether or not we override 
RequestConfig.  It would set a flag, and based on this, HttpSolrClient could 
avoid calling {{HttpClientUtils.createDefaultRequestConfigBuilder}}.  This has 
some downsides: what happens when RequestConfig invalidates some other 
SolrClient settings (e.g. read timeout), what happens when a user sets this 
flag but doesn't provide a HttpClient, etc.  But a lot of these issues can be 
minimized by advertising the setter as an "expert-level" option, and making the 
issues very clear in the Javadocs.  It's not elegant, but it'll get the job 
done.

I'll upload and test out a patch with this change.  If no one has any concerns 
with the approach, I'll go forward with it soon.

> 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
>Assignee: Jason Gerlowski
>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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-03-11 Thread JIRA


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789586#comment-16789586
 ] 

Erlend Garåsen commented on SOLR-13270:
---

A comment to your third note: Good question. Maybe it's possible to avoid 
conflicts by copying the settings in the provided RequestConfig? Take a look at 
the copy method in the RequestConfig class, even though it's deprecated.

> 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
>Assignee: Jason Gerlowski
>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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-03-05 Thread Jason Gerlowski (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-02-27 Thread JIRA


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16779378#comment-16779378
 ] 

Erlend Garåsen commented on SOLR-13270:
---

One place to solve this is in the executeMethod in HttpSolrClient.java.

The RequestConfig is indeed being overwritten:

 
{code:java}
org.apache.http.client.config.RequestConfig.Builder requestConfigBuilder = 
HttpClientUtil.createDefaultRequestConfigBuilder();

[…]

method.setConfig(requestConfigBuilder.build());
{code}
 

My suggestion is to surround the above with an _if_ to check whether a config 
already exists. If not, create a default request config and add the settings:
{code:java}
if (method.getConfig() == null) {
  org.apache.http.client.config.RequestConfig.Builder requestConfigBuilder = 
HttpClientUtil.createDefaultRequestConfigBuilder();
  if (soTimeout != null) {
    requestConfigBuilder.setSocketTimeout(soTimeout);
  }
  if (connectionTimeout != null) {
    requestConfigBuilder.setConnectTimeout(connectionTimeout);
  }
  if (followRedirects != null) {
    requestConfigBuilder.setRedirectsEnabled(followRedirects);
  }
  method.setConfig(requestConfigBuilder.build());
}{code}
 

 

 

> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-02-25 Thread Karl Wright (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16777186#comment-16777186
 ] 

Karl Wright commented on SOLR-13270:


I just grepped for it and did not find it explicitly set:

{code}
kawright@1USDKAWRIGHT:/mnt/c/wipgit/lucene4/lucene-solr$ grep -R 
"setExpectContinue" . --include "*.java"
kawright@1USDKAWRIGHT:/mnt/c/wipgit/lucene4/lucene-solr$
{code}

I therefore believe it's being set because the RequestConfig is being 
overwritten.  And, sure enough:

{code}
kawright@1USDKAWRIGHT:/mnt/c/wipgit/lucene4/lucene-solr$ grep -R 
"setDefaultRequestConfig" . --include "*.java"
./lucene/replicator/src/java/org/apache/lucene/replicator/http/HttpClientBase.java:
httpc = 
HttpClientBuilder.create().setConnectionManager(conMgr).setDefaultRequestConfig(this.defaultConfig).build();
./solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java:
HttpClientBuilder retBuilder = builder.setDefaultRequestConfig(requestConfig);
kawright@1USDKAWRIGHT:/mnt/c/wipgit/lucene4/lucene-solr$
{code}


> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-13270) SolrJ does not send "Expect: 100-continue" header

2019-02-25 Thread Karl Wright (JIRA)


[ 
https://issues.apache.org/jira/browse/SOLR-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16777113#comment-16777113
 ] 

Karl Wright commented on SOLR-13270:


Hi [~erlendfg], can you identify where in the SolrJ code it explicitly sets 
expect/continue to "off"?  It must be there somewhere.


> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org