mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-07 13:38:49 +00:00
Update http-core and http-client dependencies (#46549)
Relates to #45808 Closes #45577
This commit is contained in:
parent
de47ea2cf4
commit
e57756492a
@ -32,8 +32,8 @@ bouncycastle = 1.61
|
|||||||
# test dependencies
|
# test dependencies
|
||||||
randomizedrunner = 2.7.1
|
randomizedrunner = 2.7.1
|
||||||
junit = 4.12
|
junit = 4.12
|
||||||
httpclient = 4.5.8
|
httpclient = 4.5.10
|
||||||
httpcore = 4.4.11
|
httpcore = 4.4.12
|
||||||
httpasyncclient = 4.1.4
|
httpasyncclient = 4.1.4
|
||||||
commonslogging = 1.1.3
|
commonslogging = 1.1.3
|
||||||
commonscodec = 1.11
|
commonscodec = 1.11
|
||||||
|
@ -496,9 +496,9 @@ public class IndexLifecycleClient {
|
|||||||
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
|
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
|
||||||
* @param listener the listener to be notified upon request completion
|
* @param listener the listener to be notified upon request completion
|
||||||
*/
|
*/
|
||||||
public void getSnapshotLifecycleStatsAsync(GetSnapshotLifecycleStatsRequest request, RequestOptions options,
|
public Cancellable getSnapshotLifecycleStatsAsync(GetSnapshotLifecycleStatsRequest request, RequestOptions options,
|
||||||
ActionListener<GetSnapshotLifecycleStatsResponse> listener) {
|
ActionListener<GetSnapshotLifecycleStatsResponse> listener) {
|
||||||
restHighLevelClient.performRequestAsyncAndParseEntity(request, IndexLifecycleRequestConverters::getSnapshotLifecycleStats,
|
return restHighLevelClient.performRequestAsyncAndParseEntity(request, IndexLifecycleRequestConverters::getSnapshotLifecycleStats,
|
||||||
options, GetSnapshotLifecycleStatsResponse::fromXContent, listener, emptySet());
|
options, GetSnapshotLifecycleStatsResponse::fromXContent, listener, emptySet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1036,9 +1036,9 @@ public final class SecurityClient {
|
|||||||
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
|
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
|
||||||
* @param listener the listener to be notified upon request completion
|
* @param listener the listener to be notified upon request completion
|
||||||
*/
|
*/
|
||||||
public void delegatePkiAuthenticationAsync(DelegatePkiAuthenticationRequest request, RequestOptions options,
|
public Cancellable delegatePkiAuthenticationAsync(DelegatePkiAuthenticationRequest request, RequestOptions options,
|
||||||
ActionListener<DelegatePkiAuthenticationResponse> listener) {
|
ActionListener<DelegatePkiAuthenticationResponse> listener) {
|
||||||
restHighLevelClient.performRequestAsyncAndParseEntity(request, SecurityRequestConverters::delegatePkiAuthentication, options,
|
return restHighLevelClient.performRequestAsyncAndParseEntity(request, SecurityRequestConverters::delegatePkiAuthentication, options,
|
||||||
DelegatePkiAuthenticationResponse::fromXContent, listener, emptySet());
|
DelegatePkiAuthenticationResponse::fromXContent, listener, emptySet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
client/rest/licenses/httpclient-4.5.10.jar.sha1
Normal file
1
client/rest/licenses/httpclient-4.5.10.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
7ca2e4276f4ef95e4db725a8cd4a1d1e7585b9e5
|
@ -1 +0,0 @@
|
|||||||
c27c9d6f15435dc2b6947112027b418b0eef32b9
|
|
@ -1 +0,0 @@
|
|||||||
de748cf874e4e193b42eceea9fe5574fabb9d4df
|
|
1
client/rest/licenses/httpcore-4.4.12.jar.sha1
Normal file
1
client/rest/licenses/httpcore-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
21ebaf6d532bc350ba95bd81938fa5f0e511c132
|
@ -1 +0,0 @@
|
|||||||
7d0a97d01d39cff9aa3e6db81f21fddb2435f4e6
|
|
1
client/rest/licenses/httpcore-nio-4.4.12.jar.sha1
Normal file
1
client/rest/licenses/httpcore-nio-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
84cd29eca842f31db02987cfedea245af020198b
|
@ -74,6 +74,7 @@ public class RestClientMultipleHostsIntegTests extends RestClientTestCase {
|
|||||||
int numHttpServers = randomIntBetween(2, 4);
|
int numHttpServers = randomIntBetween(2, 4);
|
||||||
httpServers = new HttpServer[numHttpServers];
|
httpServers = new HttpServer[numHttpServers];
|
||||||
httpHosts = new HttpHost[numHttpServers];
|
httpHosts = new HttpHost[numHttpServers];
|
||||||
|
waitForCancelHandler = new WaitForCancelHandler();
|
||||||
for (int i = 0; i < numHttpServers; i++) {
|
for (int i = 0; i < numHttpServers; i++) {
|
||||||
HttpServer httpServer = createHttpServer();
|
HttpServer httpServer = createHttpServer();
|
||||||
httpServers[i] = httpServer;
|
httpServers[i] = httpServer;
|
||||||
@ -98,24 +99,30 @@ public class RestClientMultipleHostsIntegTests extends RestClientTestCase {
|
|||||||
for (int statusCode : getAllStatusCodes()) {
|
for (int statusCode : getAllStatusCodes()) {
|
||||||
httpServer.createContext(pathPrefix + "/" + statusCode, new ResponseHandler(statusCode));
|
httpServer.createContext(pathPrefix + "/" + statusCode, new ResponseHandler(statusCode));
|
||||||
}
|
}
|
||||||
waitForCancelHandler = new WaitForCancelHandler();
|
|
||||||
httpServer.createContext(pathPrefix + "/wait", waitForCancelHandler);
|
httpServer.createContext(pathPrefix + "/wait", waitForCancelHandler);
|
||||||
return httpServer;
|
return httpServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class WaitForCancelHandler implements HttpHandler {
|
private static class WaitForCancelHandler implements HttpHandler {
|
||||||
private CountDownLatch cancelHandlerLatch;
|
private volatile CountDownLatch requestCameInLatch;
|
||||||
|
private volatile CountDownLatch cancelHandlerLatch;
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
cancelHandlerLatch = new CountDownLatch(1);
|
cancelHandlerLatch = new CountDownLatch(1);
|
||||||
|
requestCameInLatch = new CountDownLatch(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancelDone() {
|
void cancelDone() {
|
||||||
cancelHandlerLatch.countDown();
|
cancelHandlerLatch.countDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void awaitRequest() throws InterruptedException {
|
||||||
|
requestCameInLatch.await();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(HttpExchange exchange) throws IOException {
|
public void handle(HttpExchange exchange) throws IOException {
|
||||||
|
requestCameInLatch.countDown();
|
||||||
try {
|
try {
|
||||||
cancelHandlerLatch.await();
|
cancelHandlerLatch.await();
|
||||||
} catch (InterruptedException ignore) {
|
} catch (InterruptedException ignore) {
|
||||||
@ -226,15 +233,12 @@ public class RestClientMultipleHostsIntegTests extends RestClientTestCase {
|
|||||||
|
|
||||||
public void testCancelAsyncRequests() throws Exception {
|
public void testCancelAsyncRequests() throws Exception {
|
||||||
int numRequests = randomIntBetween(5, 20);
|
int numRequests = randomIntBetween(5, 20);
|
||||||
final CountDownLatch latch = new CountDownLatch(numRequests);
|
|
||||||
final List<Response> responses = new CopyOnWriteArrayList<>();
|
final List<Response> responses = new CopyOnWriteArrayList<>();
|
||||||
final List<Exception> exceptions = new CopyOnWriteArrayList<>();
|
final List<Exception> exceptions = new CopyOnWriteArrayList<>();
|
||||||
for (int i = 0; i < numRequests; i++) {
|
for (int i = 0; i < numRequests; i++) {
|
||||||
|
CountDownLatch latch = new CountDownLatch(1);
|
||||||
waitForCancelHandler.reset();
|
waitForCancelHandler.reset();
|
||||||
final String method = RestClientTestUtil.randomHttpMethod(getRandom());
|
Cancellable cancellable = restClient.performRequestAsync(new Request("GET", "/wait"), new ResponseListener() {
|
||||||
//we don't test status codes that are subject to retries as they interfere with hosts being stopped
|
|
||||||
final int statusCode = randomBoolean() ? randomOkStatusCode(getRandom()) : randomErrorNoRetryStatusCode(getRandom());
|
|
||||||
Cancellable cancellable = restClient.performRequestAsync(new Request(method, "/" + statusCode), new ResponseListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Response response) {
|
public void onSuccess(Response response) {
|
||||||
responses.add(response);
|
responses.add(response);
|
||||||
@ -247,10 +251,15 @@ public class RestClientMultipleHostsIntegTests extends RestClientTestCase {
|
|||||||
latch.countDown();
|
latch.countDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (randomBoolean()) {
|
||||||
|
//we wait for the request to get to the server-side otherwise we almost always cancel
|
||||||
|
// the request artificially on the client-side before even sending it
|
||||||
|
waitForCancelHandler.awaitRequest();
|
||||||
|
}
|
||||||
cancellable.cancel();
|
cancellable.cancel();
|
||||||
waitForCancelHandler.cancelDone();
|
waitForCancelHandler.cancelDone();
|
||||||
}
|
|
||||||
assertTrue(latch.await(5, TimeUnit.SECONDS));
|
assertTrue(latch.await(5, TimeUnit.SECONDS));
|
||||||
|
}
|
||||||
assertEquals(0, responses.size());
|
assertEquals(0, responses.size());
|
||||||
assertEquals(numRequests, exceptions.size());
|
assertEquals(numRequests, exceptions.size());
|
||||||
for (Exception exception : exceptions) {
|
for (Exception exception : exceptions) {
|
||||||
|
@ -105,7 +105,7 @@ public class RestClientSingleHostIntegTests extends RestClientTestCase {
|
|||||||
return httpServer;
|
return httpServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class WaitForCancelHandler implements HttpHandler {
|
private static class WaitForCancelHandler implements HttpHandler {
|
||||||
|
|
||||||
private final CountDownLatch cancelHandlerLatch = new CountDownLatch(1);
|
private final CountDownLatch cancelHandlerLatch = new CountDownLatch(1);
|
||||||
|
|
||||||
@ -259,6 +259,8 @@ public class RestClientSingleHostIntegTests extends RestClientTestCase {
|
|||||||
/**
|
/**
|
||||||
* This test verifies some assumptions that we rely upon around the way the async http client works when reusing the same request
|
* This test verifies some assumptions that we rely upon around the way the async http client works when reusing the same request
|
||||||
* throughout multiple retries, and the use of the {@link HttpRequestBase#abort()} method.
|
* throughout multiple retries, and the use of the {@link HttpRequestBase#abort()} method.
|
||||||
|
* In fact the low-level REST client reuses the same request instance throughout multiple retries, and relies on the http client
|
||||||
|
* to set the future ref to the request properly so that when abort is called, the proper future gets cancelled.
|
||||||
*/
|
*/
|
||||||
public void testRequestResetAndAbort() throws Exception {
|
public void testRequestResetAndAbort() throws Exception {
|
||||||
try (CloseableHttpAsyncClient client = HttpAsyncClientBuilder.create().build()) {
|
try (CloseableHttpAsyncClient client = HttpAsyncClientBuilder.create().build()) {
|
||||||
@ -273,10 +275,15 @@ public class RestClientSingleHostIntegTests extends RestClientTestCase {
|
|||||||
{
|
{
|
||||||
httpGet.reset();
|
httpGet.reset();
|
||||||
assertFalse(httpGet.isAborted());
|
assertFalse(httpGet.isAborted());
|
||||||
httpGet.abort();//this has no effect on the next call (although isAborted will return true until the next reset)
|
httpGet.abort();
|
||||||
Future<HttpResponse> future = client.execute(httpHost, httpGet, null);
|
Future<HttpResponse> future = client.execute(httpHost, httpGet, null);
|
||||||
assertEquals(200, future.get().getStatusLine().getStatusCode());
|
try {
|
||||||
assertFalse(future.isCancelled());
|
future.get();
|
||||||
|
fail("expected cancellation exception");
|
||||||
|
} catch(CancellationException e) {
|
||||||
|
//expected
|
||||||
|
}
|
||||||
|
assertTrue(future.isCancelled());
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
httpGet.reset();
|
httpGet.reset();
|
||||||
|
1
client/sniffer/licenses/httpclient-4.5.10.jar.sha1
Normal file
1
client/sniffer/licenses/httpclient-4.5.10.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
7ca2e4276f4ef95e4db725a8cd4a1d1e7585b9e5
|
@ -1 +0,0 @@
|
|||||||
c27c9d6f15435dc2b6947112027b418b0eef32b9
|
|
@ -1 +0,0 @@
|
|||||||
de748cf874e4e193b42eceea9fe5574fabb9d4df
|
|
1
client/sniffer/licenses/httpcore-4.4.12.jar.sha1
Normal file
1
client/sniffer/licenses/httpcore-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
21ebaf6d532bc350ba95bd81938fa5f0e511c132
|
@ -0,0 +1 @@
|
|||||||
|
7ca2e4276f4ef95e4db725a8cd4a1d1e7585b9e5
|
@ -1 +0,0 @@
|
|||||||
c27c9d6f15435dc2b6947112027b418b0eef32b9
|
|
@ -1 +0,0 @@
|
|||||||
de748cf874e4e193b42eceea9fe5574fabb9d4df
|
|
@ -0,0 +1 @@
|
|||||||
|
21ebaf6d532bc350ba95bd81938fa5f0e511c132
|
@ -0,0 +1 @@
|
|||||||
|
7ca2e4276f4ef95e4db725a8cd4a1d1e7585b9e5
|
@ -1 +0,0 @@
|
|||||||
c27c9d6f15435dc2b6947112027b418b0eef32b9
|
|
@ -1 +0,0 @@
|
|||||||
de748cf874e4e193b42eceea9fe5574fabb9d4df
|
|
1
plugins/discovery-ec2/licenses/httpcore-4.4.12.jar.sha1
Normal file
1
plugins/discovery-ec2/licenses/httpcore-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
21ebaf6d532bc350ba95bd81938fa5f0e511c132
|
@ -0,0 +1 @@
|
|||||||
|
7ca2e4276f4ef95e4db725a8cd4a1d1e7585b9e5
|
@ -1 +0,0 @@
|
|||||||
c27c9d6f15435dc2b6947112027b418b0eef32b9
|
|
@ -1 +0,0 @@
|
|||||||
de748cf874e4e193b42eceea9fe5574fabb9d4df
|
|
1
plugins/discovery-gce/licenses/httpcore-4.4.12.jar.sha1
Normal file
1
plugins/discovery-gce/licenses/httpcore-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
21ebaf6d532bc350ba95bd81938fa5f0e511c132
|
@ -0,0 +1 @@
|
|||||||
|
7ca2e4276f4ef95e4db725a8cd4a1d1e7585b9e5
|
@ -1 +0,0 @@
|
|||||||
c27c9d6f15435dc2b6947112027b418b0eef32b9
|
|
@ -1 +0,0 @@
|
|||||||
de748cf874e4e193b42eceea9fe5574fabb9d4df
|
|
1
plugins/repository-gcs/licenses/httpcore-4.4.12.jar.sha1
Normal file
1
plugins/repository-gcs/licenses/httpcore-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
21ebaf6d532bc350ba95bd81938fa5f0e511c132
|
@ -0,0 +1 @@
|
|||||||
|
7ca2e4276f4ef95e4db725a8cd4a1d1e7585b9e5
|
@ -1 +0,0 @@
|
|||||||
c27c9d6f15435dc2b6947112027b418b0eef32b9
|
|
@ -1 +0,0 @@
|
|||||||
de748cf874e4e193b42eceea9fe5574fabb9d4df
|
|
1
plugins/repository-s3/licenses/httpcore-4.4.12.jar.sha1
Normal file
1
plugins/repository-s3/licenses/httpcore-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
21ebaf6d532bc350ba95bd81938fa5f0e511c132
|
1
x-pack/plugin/core/licenses/httpclient-4.5.10.jar.sha1
Normal file
1
x-pack/plugin/core/licenses/httpclient-4.5.10.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
7ca2e4276f4ef95e4db725a8cd4a1d1e7585b9e5
|
@ -1 +0,0 @@
|
|||||||
c27c9d6f15435dc2b6947112027b418b0eef32b9
|
|
@ -1 +0,0 @@
|
|||||||
de748cf874e4e193b42eceea9fe5574fabb9d4df
|
|
1
x-pack/plugin/core/licenses/httpcore-4.4.12.jar.sha1
Normal file
1
x-pack/plugin/core/licenses/httpcore-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
21ebaf6d532bc350ba95bd81938fa5f0e511c132
|
@ -1 +0,0 @@
|
|||||||
7d0a97d01d39cff9aa3e6db81f21fddb2435f4e6
|
|
1
x-pack/plugin/core/licenses/httpcore-nio-4.4.12.jar.sha1
Normal file
1
x-pack/plugin/core/licenses/httpcore-nio-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
84cd29eca842f31db02987cfedea245af020198b
|
@ -0,0 +1 @@
|
|||||||
|
b195778247a21e980cb9f80c41364dc0c38feaef
|
@ -1 +0,0 @@
|
|||||||
bb984b73da2153285b660f3e278498abd94ccbb5
|
|
1
x-pack/snapshot-tool/licenses/httpclient-4.5.10.jar.sha1
Normal file
1
x-pack/snapshot-tool/licenses/httpclient-4.5.10.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
7ca2e4276f4ef95e4db725a8cd4a1d1e7585b9e5
|
@ -1 +0,0 @@
|
|||||||
c27c9d6f15435dc2b6947112027b418b0eef32b9
|
|
@ -1 +0,0 @@
|
|||||||
de748cf874e4e193b42eceea9fe5574fabb9d4df
|
|
1
x-pack/snapshot-tool/licenses/httpcore-4.4.12.jar.sha1
Normal file
1
x-pack/snapshot-tool/licenses/httpcore-4.4.12.jar.sha1
Normal file
@ -0,0 +1 @@
|
|||||||
|
21ebaf6d532bc350ba95bd81938fa5f0e511c132
|
Loading…
x
Reference in New Issue
Block a user