OpenSearch/modules
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
..
aggs-matrix-stats Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
ingest-common Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
lang-expression Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
lang-groovy Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
lang-mustache Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
lang-painless Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
percolator Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
reindex Rest client: don't reuse that same HttpAsyncResponseConsumer across multiple retries (#21378) 2016-11-08 16:42:42 +01:00
transport-netty3 Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
transport-netty4 Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
build.gradle Build: Change `gradle run` to use zip distribution (#21001) 2016-10-18 11:48:58 -07:00