OpenSearch/client
Luca Cavanna 293a3cab01 Rest client: don't reuse that same HttpAsyncResponseConsumer across multiple retries (#21378)
* Rest client: don't reuse that same HttpAsyncResponseConsumer across multiple retries

Turns out that AbstractAsyncResponseConsumer from apache async http client is stateful and cannot be reused across multiple requests. The failover mechanism was mistakenly reusing that same instance, which can be provided by users, across retries in case nodes are down or return 5xx errors. The downside is that we have to change the signature of two public methods, as HttpAsyncResponseConsumer cannot be provided directly anymore, rather its factory needs to be provided which is going to be used to create one instance of the consumer per request attempt.

Up until now we tested our RestClient against multiple nodes only in a mock environment, where we don't really send http requests. In that scenario we can verify that retries etc. work properly but the interaction with the http client library in a real scenario is different and can catch other problems. With this commit we also add an integration test that sends requests to multiple hosts, and some of them may also get stopped meanwhile. The specific test for pathPrefix was also removed as pathPrefix is now randomly applied by default, hence implicitly tested. Moved also a small test method that checked the validity of the path argument to the unit test RestClientSingleHostTests.

Also increase default buffer limit to 100MB and make it required in default consumer

The default buffer limit used to be 10MB but that proved not to be high enough for scroll requests (see reindex from remote). With this commit we increase the limit to 100MB and make it a bit more visibile in the consumer factory.
2016-11-08 16:42:42 +01:00
..
benchmark Remove LocalTransport in favor of MockTcpTransport (#20695) 2016-10-07 11:27:47 +02:00
client-benchmark-noop-api-plugin rename DocumentRequest to DocWriteRequest 2016-10-11 16:00:10 -04:00
rest Rest client: don't reuse that same HttpAsyncResponseConsumer across multiple retries (#21378) 2016-11-08 16:42:42 +01:00
sniffer Upgrade to lucene-6.3.0-snapshot-ed102d6 (#21150) 2016-10-28 14:47:15 +02:00
test Build: Remove old maven deploy support (#20403) 2016-09-19 15:10:41 -07:00
transport Skip transport client plugin installed on JDK 9 2016-08-31 09:46:27 -04:00