Skip to content

Commit 1a2b5ea

Browse files
authored
Merge branch 'main' into lucene_snapshot_10_1
2 parents 67ba016 + 4640165 commit 1a2b5ea

File tree

77 files changed

+1032
-825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1032
-825
lines changed

docs/changelog/119580.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 119580
2+
summary: Do not serialize `EsIndex` in plan
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/120458.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120458
2+
summary: Do not recommend increasing `max_shards_per_node`
3+
area: Health
4+
type: bug
5+
issues: []

libs/entitlement/bridge/src/main/java/org/elasticsearch/entitlement/bridge/EntitlementChecker.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,7 @@ public interface EntitlementChecker {
269269
// Network miscellanea
270270
void check$java_net_URL$openConnection(Class<?> callerClass, java.net.URL that, Proxy proxy);
271271

272-
// HttpClient.Builder is an interface, so we instrument its only (internal) implementation
273-
void check$jdk_internal_net_http_HttpClientBuilderImpl$build(Class<?> callerClass, HttpClient.Builder that);
274-
275-
// HttpClient#send and sendAsync are abstract, so we instrument their internal implementation
272+
// HttpClient#send and sendAsync are abstract, so we instrument their internal implementations
276273
void check$jdk_internal_net_http_HttpClientImpl$send(
277274
Class<?> callerClass,
278275
HttpClient that,
@@ -295,6 +292,28 @@ public interface EntitlementChecker {
295292
HttpResponse.PushPromiseHandler<?> pushPromiseHandler
296293
);
297294

295+
void check$jdk_internal_net_http_HttpClientFacade$send(
296+
Class<?> callerClass,
297+
HttpClient that,
298+
HttpRequest request,
299+
HttpResponse.BodyHandler<?> responseBodyHandler
300+
);
301+
302+
void check$jdk_internal_net_http_HttpClientFacade$sendAsync(
303+
Class<?> callerClass,
304+
HttpClient that,
305+
HttpRequest userRequest,
306+
HttpResponse.BodyHandler<?> responseHandler
307+
);
308+
309+
void check$jdk_internal_net_http_HttpClientFacade$sendAsync(
310+
Class<?> callerClass,
311+
HttpClient that,
312+
HttpRequest userRequest,
313+
HttpResponse.BodyHandler<?> responseHandler,
314+
HttpResponse.PushPromiseHandler<?> pushPromiseHandler
315+
);
316+
298317
// We need to check the LDAPCertStore, as this will connect, but this is internal/created via SPI,
299318
// so we instrument the general factory instead and then filter in the check method implementation
300319
void check$java_security_cert_CertStore$$getInstance(Class<?> callerClass, String type, CertStoreParameters params);

libs/entitlement/qa/common/src/main/java/org/elasticsearch/entitlement/qa/common/NetworkAccessCheckActions.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
import java.net.SocketException;
2121
import java.net.URI;
2222
import java.net.URISyntaxException;
23-
import java.net.http.HttpClient;
24-
import java.net.http.HttpRequest;
25-
import java.net.http.HttpResponse;
2623
import java.nio.ByteBuffer;
2724
import java.nio.channels.AsynchronousServerSocketChannel;
2825
import java.nio.channels.AsynchronousSocketChannel;
@@ -84,43 +81,6 @@ static void urlOpenConnectionWithProxy() throws URISyntaxException, IOException
8481
assert urlConnection != null;
8582
}
8683

87-
static void httpClientBuilderBuild() {
88-
try (HttpClient httpClient = HttpClient.newBuilder().build()) {
89-
assert httpClient != null;
90-
}
91-
}
92-
93-
static void httpClientSend() throws InterruptedException {
94-
try (HttpClient httpClient = HttpClient.newBuilder().build()) {
95-
// Shutdown the client, so the send action will shortcut before actually executing any network operation
96-
// (but after it run our check in the prologue)
97-
httpClient.shutdown();
98-
try {
99-
httpClient.send(HttpRequest.newBuilder(URI.create("http://localhost")).build(), HttpResponse.BodyHandlers.discarding());
100-
} catch (IOException e) {
101-
// Expected, since we shut down the client.
102-
// "send" will be called and exercise the Entitlement check, we don't care if it fails afterward for this known reason.
103-
}
104-
}
105-
}
106-
107-
static void httpClientSendAsync() {
108-
try (HttpClient httpClient = HttpClient.newBuilder().build()) {
109-
// Shutdown the client, so the send action will return before actually executing any network operation
110-
// (but after it run our check in the prologue)
111-
httpClient.shutdown();
112-
var future = httpClient.sendAsync(
113-
HttpRequest.newBuilder(URI.create("http://localhost")).build(),
114-
HttpResponse.BodyHandlers.discarding()
115-
);
116-
assert future.isCompletedExceptionally();
117-
future.exceptionally(ex -> {
118-
assert ex instanceof IOException;
119-
return null;
120-
});
121-
}
122-
}
123-
12484
static void createLDAPCertStore() throws NoSuchAlgorithmException {
12585
try {
12686
// We pass down null params to provoke a InvalidAlgorithmParameterException

libs/entitlement/qa/common/src/main/java/org/elasticsearch/entitlement/qa/common/RestEntitlementsCheckAction.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,8 @@ static CheckAction alwaysDenied(CheckedRunnable<Exception> action) {
160160
entry("server_socket_accept", forPlugins(NetworkAccessCheckActions::serverSocketAccept)),
161161

162162
entry("url_open_connection_proxy", forPlugins(NetworkAccessCheckActions::urlOpenConnectionWithProxy)),
163-
entry("http_client_builder_build", forPlugins(NetworkAccessCheckActions::httpClientBuilderBuild)),
164-
entry("http_client_send", forPlugins(NetworkAccessCheckActions::httpClientSend)),
165-
entry("http_client_send_async", forPlugins(NetworkAccessCheckActions::httpClientSendAsync)),
163+
entry("http_client_send", forPlugins(VersionSpecificNetworkChecks::httpClientSend)),
164+
entry("http_client_send_async", forPlugins(VersionSpecificNetworkChecks::httpClientSendAsync)),
166165
entry("create_ldap_cert_store", forPlugins(NetworkAccessCheckActions::createLDAPCertStore)),
167166

168167
entry("server_socket_channel_bind", forPlugins(NetworkAccessCheckActions::serverSocketChannelBind)),

libs/entitlement/qa/common/src/main/java/org/elasticsearch/entitlement/qa/common/VersionSpecificNetworkChecks.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,26 @@
99

1010
package org.elasticsearch.entitlement.qa.common;
1111

12+
import java.io.IOException;
13+
import java.net.URI;
14+
import java.net.http.HttpClient;
15+
import java.net.http.HttpRequest;
16+
import java.net.http.HttpResponse;
17+
1218
class VersionSpecificNetworkChecks {
1319
static void createInetAddressResolverProvider() {}
20+
21+
static void httpClientSend() throws InterruptedException {
22+
HttpClient httpClient = HttpClient.newBuilder().build();
23+
try {
24+
httpClient.send(HttpRequest.newBuilder(URI.create("http://localhost")).build(), HttpResponse.BodyHandlers.discarding());
25+
} catch (IOException e) {
26+
// Expected, the send action may fail with these parameters (but after it run the entitlement check in the prologue)
27+
}
28+
}
29+
30+
static void httpClientSendAsync() {
31+
HttpClient httpClient = HttpClient.newBuilder().build();
32+
httpClient.sendAsync(HttpRequest.newBuilder(URI.create("http://localhost")).build(), HttpResponse.BodyHandlers.discarding());
33+
}
1434
}

libs/entitlement/qa/common/src/main18/java/org/elasticsearch/entitlement/qa/common/VersionSpecificNetworkChecks.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
package org.elasticsearch.entitlement.qa.common;
1111

12+
import java.io.IOException;
13+
import java.net.URI;
14+
import java.net.http.HttpClient;
15+
import java.net.http.HttpRequest;
16+
import java.net.http.HttpResponse;
1217
import java.net.spi.InetAddressResolver;
1318
import java.net.spi.InetAddressResolverProvider;
1419

@@ -26,4 +31,18 @@ public String name() {
2631
}
2732
};
2833
}
34+
35+
static void httpClientSend() throws InterruptedException {
36+
HttpClient httpClient = HttpClient.newBuilder().build();
37+
try {
38+
httpClient.send(HttpRequest.newBuilder(URI.create("http://localhost")).build(), HttpResponse.BodyHandlers.discarding());
39+
} catch (IOException e) {
40+
// Expected, the send action may fail with these parameters (but after it run the entitlement check in the prologue)
41+
}
42+
}
43+
44+
static void httpClientSendAsync() {
45+
HttpClient httpClient = HttpClient.newBuilder().build();
46+
httpClient.sendAsync(HttpRequest.newBuilder(URI.create("http://localhost")).build(), HttpResponse.BodyHandlers.discarding());
47+
}
2948
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.entitlement.qa.common;
11+
12+
import java.io.IOException;
13+
import java.net.URI;
14+
import java.net.http.HttpClient;
15+
import java.net.http.HttpRequest;
16+
import java.net.http.HttpResponse;
17+
import java.net.spi.InetAddressResolver;
18+
import java.net.spi.InetAddressResolverProvider;
19+
20+
class VersionSpecificNetworkChecks {
21+
static void createInetAddressResolverProvider() {
22+
var x = new InetAddressResolverProvider() {
23+
@Override
24+
public InetAddressResolver get(Configuration configuration) {
25+
return null;
26+
}
27+
28+
@Override
29+
public String name() {
30+
return "TEST";
31+
}
32+
};
33+
}
34+
35+
static void httpClientSend() throws InterruptedException {
36+
try (HttpClient httpClient = HttpClient.newBuilder().build()) {
37+
// Shutdown the client, so the send action will shortcut before actually executing any network operation
38+
// (but after it run our check in the prologue)
39+
httpClient.shutdown();
40+
try {
41+
httpClient.send(HttpRequest.newBuilder(URI.create("http://localhost")).build(), HttpResponse.BodyHandlers.discarding());
42+
} catch (IOException e) {
43+
// Expected, since we shut down the client
44+
}
45+
}
46+
}
47+
48+
static void httpClientSendAsync() {
49+
try (HttpClient httpClient = HttpClient.newBuilder().build()) {
50+
// Shutdown the client, so the send action will return before actually executing any network operation
51+
// (but after it run our check in the prologue)
52+
httpClient.shutdown();
53+
var future = httpClient.sendAsync(
54+
HttpRequest.newBuilder(URI.create("http://localhost")).build(),
55+
HttpResponse.BodyHandlers.discarding()
56+
);
57+
assert future.isCompletedExceptionally();
58+
future.exceptionally(ex -> {
59+
assert ex instanceof IOException;
60+
return null;
61+
});
62+
}
63+
}
64+
}
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
ALL-UNNAMED:
22
- create_class_loader
33
- set_https_connection_properties
4-
- network:
5-
actions:
6-
- listen
7-
- accept
8-
- connect
4+
- inbound_network
5+
- outbound_network
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
org.elasticsearch.entitlement.qa.common:
22
- create_class_loader
33
- set_https_connection_properties
4-
- network:
5-
actions:
6-
- listen
7-
- accept
8-
- connect
4+
- inbound_network
5+
- outbound_network

0 commit comments

Comments
 (0)