Skip to content

Commit e409dae

Browse files
Merge remote-tracking branch 'elastic/main' into batched-exec-short
2 parents 95e7257 + 2113a3c commit e409dae

File tree

22 files changed

+180
-22
lines changed

22 files changed

+180
-22
lines changed

build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ develocity {
133133
}
134134
} else {
135135
tag 'LOCAL'
136+
if (providers.systemProperty('idea.active').present) {
137+
tag 'IDEA'
138+
}
136139
}
137140
}
138141
}

build-tools-internal/src/main/groovy/elasticsearch.ide.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
179179

180180
// this path is produced by the extractLibs task above
181181
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
182-
182+
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
183183
idea {
184184
project {
185185
vcs = 'Git'
@@ -209,6 +209,11 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
209209
}
210210
}
211211
runConfigurations {
212+
defaults(org.jetbrains.gradle.ext.Gradle) {
213+
scriptParameters = enableIdeaCC ? [
214+
'--configuration-cache'
215+
].join(' ') : ''
216+
}
212217
defaults(JUnit) {
213218
vmParameters = [
214219
'-ea',

docs/changelog/123569.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 123569
2+
summary: Abort pending deletion on `IndicesService` close
3+
area: Store
4+
type: enhancement
5+
issues: []

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ org.gradle.dependency.verification.console=verbose
1919

2020
# allow user to specify toolchain via the RUNTIME_JAVA_HOME environment variable
2121
org.gradle.java.installations.fromEnv=RUNTIME_JAVA_HOME
22+
23+
# if configuration cache enabled then enable parallel support too
24+
org.gradle.configuration-cache.parallel=true

libs/ssl-config/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ apply plugin: "elasticsearch.publish"
1010

1111
dependencies {
1212
api project(':libs:core')
13+
api project(':libs:entitlement')
1314

1415
testImplementation(project(":test:framework")) {
1516
exclude group: 'org.elasticsearch', module: 'ssl-config'

libs/ssl-config/src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
module org.elasticsearch.sslconfig {
1111
requires org.elasticsearch.base;
12+
requires org.elasticsearch.entitlement;
1213

1314
exports org.elasticsearch.common.ssl;
1415
}

libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/PemKeyConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.elasticsearch.common.ssl;
1111

1212
import org.elasticsearch.core.Tuple;
13+
import org.elasticsearch.entitlement.runtime.api.NotEntitledException;
1314

1415
import java.io.IOException;
1516
import java.nio.file.Path;
@@ -127,6 +128,8 @@ private PrivateKey getPrivateKey(Path path) {
127128
return privateKey;
128129
} catch (AccessControlException e) {
129130
throw SslFileUtil.accessControlFailure(KEY_FILE_TYPE, List.of(path), e, configBasePath);
131+
} catch (NotEntitledException e) {
132+
throw SslFileUtil.notEntitledFailure(KEY_FILE_TYPE, List.of(path), e, configBasePath);
130133
} catch (IOException e) {
131134
throw SslFileUtil.ioException(KEY_FILE_TYPE, List.of(path), e);
132135
} catch (GeneralSecurityException e) {

libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/PemTrustConfig.java

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

1010
package org.elasticsearch.common.ssl;
1111

12+
import org.elasticsearch.entitlement.runtime.api.NotEntitledException;
13+
1214
import java.io.IOException;
1315
import java.io.InputStream;
1416
import java.nio.file.Path;
@@ -99,6 +101,8 @@ private List<Certificate> readCertificates(List<Path> paths) {
99101
return PemUtils.readCertificates(paths);
100102
} catch (AccessControlException e) {
101103
throw SslFileUtil.accessControlFailure(CA_FILE_TYPE, paths, e, basePath);
104+
} catch (NotEntitledException e) {
105+
throw SslFileUtil.notEntitledFailure(CA_FILE_TYPE, paths, e, basePath);
102106
} catch (IOException e) {
103107
throw SslFileUtil.ioException(CA_FILE_TYPE, paths, e);
104108
} catch (GeneralSecurityException e) {

libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/PemUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.elasticsearch.common.ssl;
1111

1212
import org.elasticsearch.core.CharArrays;
13+
import org.elasticsearch.entitlement.runtime.api.NotEntitledException;
1314

1415
import java.io.BufferedReader;
1516
import java.io.IOException;
@@ -112,6 +113,8 @@ public static PrivateKey readPrivateKey(Path path, Supplier<char[]> passwordSupp
112113
return privateKey;
113114
} catch (AccessControlException e) {
114115
throw SslFileUtil.accessControlFailure("PEM private key", List.of(path), e, null);
116+
} catch (NotEntitledException e) {
117+
throw SslFileUtil.notEntitledFailure("PEM private key", List.of(path), e, null);
115118
} catch (IOException e) {
116119
throw SslFileUtil.ioException("PEM private key", List.of(path), e);
117120
} catch (GeneralSecurityException e) {

libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/SslFileUtil.java

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

1010
package org.elasticsearch.common.ssl;
1111

12+
import org.elasticsearch.entitlement.runtime.api.NotEntitledException;
13+
1214
import java.io.FileNotFoundException;
1315
import java.io.IOException;
1416
import java.nio.file.AccessDeniedException;
@@ -78,7 +80,15 @@ static SslConfigException accessDenied(String fileType, List<Path> paths, Access
7880
return new SslConfigException(message, cause);
7981
}
8082

83+
static SslConfigException notEntitledFailure(String fileType, List<Path> paths, NotEntitledException cause, Path basePath) {
84+
return innerAccessControlFailure(fileType, paths, cause, basePath);
85+
}
86+
8187
static SslConfigException accessControlFailure(String fileType, List<Path> paths, AccessControlException cause, Path basePath) {
88+
return innerAccessControlFailure(fileType, paths, cause, basePath);
89+
}
90+
91+
private static SslConfigException innerAccessControlFailure(String fileType, List<Path> paths, Exception cause, Path basePath) {
8292
String message = "cannot read configured " + fileType + " [" + pathsToString(paths) + "] because ";
8393
if (paths.size() == 1) {
8494
message += "access to read the file is blocked";

0 commit comments

Comments
 (0)