Skip to content

Commit 0c9c3c4

Browse files
committed
address feedback
1 parent ae3eb71 commit 0c9c3c4

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ private Map<ReplacementKey, String> jvmOptionExpansions() {
14601460
Version version = getVersion();
14611461

14621462
ReplacementKey heapDumpPathSub;
1463-
if (version.before("8.18.0") && version.onOrAfter("6.3.0")) {
1463+
if (version.before("8.19.0") && version.onOrAfter("6.3.0")) {
14641464
heapDumpPathSub = new ReplacementKey("-XX:HeapDumpPath=data", "");
14651465
} else {
14661466
// temporarily fall back to the old substitution so both old and new work during backport
@@ -1469,7 +1469,7 @@ private Map<ReplacementKey, String> jvmOptionExpansions() {
14691469
expansions.put(heapDumpPathSub, "-XX:HeapDumpPath=" + confPathLogs);
14701470

14711471
ReplacementKey gcLogSub;
1472-
if (version.before("8.18.0") && version.onOrAfter("6.2.0")) {
1472+
if (version.before("8.19.0") && version.onOrAfter("6.2.0")) {
14731473
gcLogSub = new ReplacementKey("logs/gc.log", "");
14741474
} else {
14751475
// temporarily check the old substitution first so both old and new work during backport
@@ -1478,7 +1478,7 @@ private Map<ReplacementKey, String> jvmOptionExpansions() {
14781478
expansions.put(gcLogSub, confPathLogs.resolve("gc.log").toString());
14791479

14801480
ReplacementKey errorFileSub;
1481-
if (version.before("8.18.0") && version.getMajor() >= 7) {
1481+
if (version.before("8.19.0") && version.getMajor() >= 7) {
14821482
errorFileSub = new ReplacementKey("-XX:ErrorFile=logs/hs_err_pid%p.log", "");
14831483
} else {
14841484
// temporarily check the old substitution first so both old and new work during backport

distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/JvmOption.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ private static List<String> flagsFinal(final List<String> userDefinedJvmOptions)
130130

131131
@SuppressForbidden(reason = "ProcessBuilder takes File")
132132
private static void setWorkingDir(ProcessBuilder builder) throws IOException {
133-
// set temp dir as working dir so it is writeable
133+
// The real ES process uses the logs dir as the working directory. Since we don't
134+
// have the logs dir yet, here we use a temp directory for calculating jvm options.
134135
final Path tmpDir = Files.createTempDirectory("final-flags");
135136
builder.directory(tmpDir.toFile());
136137
}

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ private Map<ReplacementKey, String> getJvmOptionsReplacements() {
924924
var version = spec.getVersion();
925925

926926
ReplacementKey heapDumpPathSub;
927-
if (version.before("8.18.0") && version.onOrAfter("6.3.0")) {
927+
if (version.before("8.19.0") && version.onOrAfter("6.3.0")) {
928928
heapDumpPathSub = new ReplacementKey("-XX:HeapDumpPath=data", "");
929929
} else {
930930
// temporarily fall back to the old substitution so both old and new work during backport
@@ -933,7 +933,7 @@ private Map<ReplacementKey, String> getJvmOptionsReplacements() {
933933
expansions.put(heapDumpPathSub, "-XX:HeapDumpPath=" + logsDir);
934934

935935
ReplacementKey gcLogSub;
936-
if (version.before("8.18.0") && version.onOrAfter("6.2.0")) {
936+
if (version.before("8.19.0") && version.onOrAfter("6.2.0")) {
937937
gcLogSub = new ReplacementKey("logs/gc.log", "");
938938
} else {
939939
// temporarily check the old substitution first so both old and new work during backport
@@ -942,7 +942,7 @@ private Map<ReplacementKey, String> getJvmOptionsReplacements() {
942942
expansions.put(gcLogSub, logsDir.resolve("gc.log").toString());
943943

944944
ReplacementKey errorFileSub;
945-
if (version.before("8.18.0") && version.getMajor() >= 7) {
945+
if (version.before("8.19.0") && version.getMajor() >= 7) {
946946
errorFileSub = new ReplacementKey("-XX:ErrorFile=logs/hs_err_pid%p.log", "");
947947
} else {
948948
// temporarily check the old substitution first so both old and new work during backport

0 commit comments

Comments
 (0)