Skip to content

Commit

Permalink
Merge branch 'main' into threadpool-merge-scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
albertzaharovits authored Jan 20, 2025
2 parents 3f5b4a8 + cd86b3b commit 0e714a1
Show file tree
Hide file tree
Showing 34 changed files with 318 additions and 425 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/120458.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 120458
summary: Do not recommend increasing `max_shards_per_node`
area: Health
type: bug
issues: []
2 changes: 1 addition & 1 deletion docs/reference/quickstart/aggs-tutorial.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ GET kibana_sample_data_ecommerce/_search
----
// TEST[skip:Using Kibana sample data]
<1> Descriptive name for the time-series aggregation results.
<2> The `date_histogram` aggregration groups documents into time-based buckets, similar to terms aggregation but for dates.
<2> The `date_histogram` aggregation groups documents into time-based buckets, similar to terms aggregation but for dates.
<3> Uses <<calendar_and_fixed_intervals,calendar and fixed time intervals>> to handle months with different lengths. `"day"` ensures consistent daily grouping regardless of timezone.
<4> Formats dates in response using <<mapping-date-format,date patterns>> (e.g. "yyyy-MM-dd"). Refer to <<date-math,date math expressions>> for additional options.
<5> When `min_doc_count` is 0, returns buckets for days with no orders, useful for continuous time series visualization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,7 @@ public interface EntitlementChecker {
// Network miscellanea
void check$java_net_URL$openConnection(Class<?> callerClass, java.net.URL that, Proxy proxy);

// HttpClient.Builder is an interface, so we instrument its only (internal) implementation
void check$jdk_internal_net_http_HttpClientBuilderImpl$build(Class<?> callerClass, HttpClient.Builder that);

// HttpClient#send and sendAsync are abstract, so we instrument their internal implementation
// HttpClient#send and sendAsync are abstract, so we instrument their internal implementations
void check$jdk_internal_net_http_HttpClientImpl$send(
Class<?> callerClass,
HttpClient that,
Expand All @@ -295,6 +292,28 @@ public interface EntitlementChecker {
HttpResponse.PushPromiseHandler<?> pushPromiseHandler
);

void check$jdk_internal_net_http_HttpClientFacade$send(
Class<?> callerClass,
HttpClient that,
HttpRequest request,
HttpResponse.BodyHandler<?> responseBodyHandler
);

void check$jdk_internal_net_http_HttpClientFacade$sendAsync(
Class<?> callerClass,
HttpClient that,
HttpRequest userRequest,
HttpResponse.BodyHandler<?> responseHandler
);

void check$jdk_internal_net_http_HttpClientFacade$sendAsync(
Class<?> callerClass,
HttpClient that,
HttpRequest userRequest,
HttpResponse.BodyHandler<?> responseHandler,
HttpResponse.PushPromiseHandler<?> pushPromiseHandler
);

// We need to check the LDAPCertStore, as this will connect, but this is internal/created via SPI,
// so we instrument the general factory instead and then filter in the check method implementation
void check$java_security_cert_CertStore$$getInstance(Class<?> callerClass, String type, CertStoreParameters params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ static void urlOpenConnectionWithProxy() throws URISyntaxException, IOException
assert urlConnection != null;
}

static void httpClientBuilderBuild() {
try (HttpClient httpClient = HttpClient.newBuilder().build()) {
assert httpClient != null;
}
}

static void httpClientSend() throws InterruptedException {
try (HttpClient httpClient = HttpClient.newBuilder().build()) {
// Shutdown the client, so the send action will shortcut before actually executing any network operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ static CheckAction alwaysDenied(CheckedRunnable<Exception> action) {
entry("server_socket_accept", forPlugins(NetworkAccessCheckActions::serverSocketAccept)),

entry("url_open_connection_proxy", forPlugins(NetworkAccessCheckActions::urlOpenConnectionWithProxy)),
entry("http_client_builder_build", forPlugins(NetworkAccessCheckActions::httpClientBuilderBuild)),
entry("http_client_send", forPlugins(NetworkAccessCheckActions::httpClientSend)),
entry("http_client_send_async", forPlugins(NetworkAccessCheckActions::httpClientSendAsync)),
entry("create_ldap_cert_store", forPlugins(NetworkAccessCheckActions::createLDAPCertStore)),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
ALL-UNNAMED:
- create_class_loader
- set_https_connection_properties
- network:
actions:
- listen
- accept
- connect
- inbound_network
- outbound_network
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
org.elasticsearch.entitlement.qa.common:
- create_class_loader
- set_https_connection_properties
- network:
actions:
- listen
- accept
- connect
- inbound_network
- outbound_network
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import org.elasticsearch.entitlement.runtime.policy.CreateClassLoaderEntitlement;
import org.elasticsearch.entitlement.runtime.policy.Entitlement;
import org.elasticsearch.entitlement.runtime.policy.ExitVMEntitlement;
import org.elasticsearch.entitlement.runtime.policy.NetworkEntitlement;
import org.elasticsearch.entitlement.runtime.policy.InboundNetworkEntitlement;
import org.elasticsearch.entitlement.runtime.policy.OutboundNetworkEntitlement;
import org.elasticsearch.entitlement.runtime.policy.Policy;
import org.elasticsearch.entitlement.runtime.policy.PolicyManager;
import org.elasticsearch.entitlement.runtime.policy.PolicyParser;
Expand All @@ -45,9 +46,6 @@
import java.util.Set;
import java.util.stream.Collectors;

import static org.elasticsearch.entitlement.runtime.policy.NetworkEntitlement.ACCEPT_ACTION;
import static org.elasticsearch.entitlement.runtime.policy.NetworkEntitlement.CONNECT_ACTION;
import static org.elasticsearch.entitlement.runtime.policy.NetworkEntitlement.LISTEN_ACTION;
import static org.elasticsearch.entitlement.runtime.policy.PolicyManager.ALL_UNNAMED;

/**
Expand Down Expand Up @@ -106,11 +104,12 @@ private static PolicyManager createPolicyManager() throws IOException {
List.of(
new ExitVMEntitlement(),
new CreateClassLoaderEntitlement(),
new NetworkEntitlement(LISTEN_ACTION | CONNECT_ACTION | ACCEPT_ACTION)
new InboundNetworkEntitlement(),
new OutboundNetworkEntitlement()
)
),
new Scope("org.apache.httpcomponents.httpclient", List.of(new NetworkEntitlement(CONNECT_ACTION))),
new Scope("io.netty.transport", List.of(new NetworkEntitlement(LISTEN_ACTION)))
new Scope("org.apache.httpcomponents.httpclient", List.of(new OutboundNetworkEntitlement())),
new Scope("io.netty.transport", List.of(new InboundNetworkEntitlement(), new OutboundNetworkEntitlement()))
)
);
// agents run without a module, so this is a special hack for the apm agent
Expand Down
Loading

0 comments on commit 0e714a1

Please sign in to comment.