Skip to content

Conversation

breskeby
Copy link
Contributor

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.

@breskeby breskeby requested a review from a team as a code owner September 23, 2025 17:20
@breskeby breskeby added >non-issue :Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team auto-backport Automatically create backport pull requests when merged v9.2.0 v8.19.5 v9.1.5 v9.0.8 v8.18.9 labels Sep 23, 2025
@breskeby breskeby self-assigned this Sep 23, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@breskeby breskeby requested a review from rjernst September 23, 2025 17:21
@@ -1 +1 @@
security_stats_endpoint,9168000
inference_api_openai_embeddings_headers,9169000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this was changed due to a bug in transport version generation, but it is innocuous. Upstream main already contains this change, so the final squash merge won't show this change.

spec.getLanguageVersion().set(JavaLanguageVersion.of(17));
});
task.environment(
"ES_FALLBACK_JAVA_HOME",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the env var? I don't see it used anywhere else and it's not something ES knows about


private Map<String, String> getEnvironmentVariables() {
Map<String, String> environment = new HashMap<>(spec.resolveEnvironment());
String esFallbackJavaHome = System.getenv("ES_FALLBACK_JAVA_HOME");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjernst this is where the variable is used.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 759 to 800
private boolean isUbuntu2404OrLater() {
try {
if (OS.current() != OS.LINUX) {
return false;
}

// Read /etc/os-release file to get distribution info
Path osRelease = Path.of("/etc/os-release");
if (!Files.exists(osRelease)) {
return false;
}

String content = Files.readString(osRelease);
boolean isUbuntu = content.contains("ID=ubuntu");

if (!isUbuntu) {
return false;
}

// Extract version
String versionLine = content.lines().filter(line -> line.startsWith("VERSION_ID=")).findFirst().orElse("");

if (versionLine.isEmpty()) {
return false;
}

String version = versionLine.substring("VERSION_ID=".length()).replace("\"", "");
String[] parts = version.split("\\.");

if (parts.length >= 2) {
int major = Integer.parseInt(parts[0]);
int minor = Integer.parseInt(parts[1]);
return major > 24 || (major == 24 && minor >= 4);
}

return false;
} catch (Exception e) {
LOGGER.debug("Failed to detect Ubuntu version", e);
return false;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has been moved to OsUtils.isUbuntu2404OrLater() and is not needed here any more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

… Distros

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.
@breskeby breskeby force-pushed the override-jdk17-for-ubuntu2024 branch from acc05df to cab7c41 Compare September 24, 2025 08:32
@breskeby breskeby added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Sep 24, 2025
@breskeby breskeby merged commit 8927f5b into elastic:main Sep 24, 2025
34 checks passed
@breskeby breskeby deleted the override-jdk17-for-ubuntu2024 branch September 24, 2025 14:13
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Sep 24, 2025
… Distros (elastic#135300)

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Sep 24, 2025
… Distros (elastic#135300)

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Sep 24, 2025
… Distros (elastic#135300)

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Sep 24, 2025
… Distros (elastic#135300)

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19
9.1
9.0
8.18

elasticsearchmachine pushed a commit that referenced this pull request Sep 24, 2025
… Distros (#135300) (#135363)

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.
elasticsearchmachine pushed a commit that referenced this pull request Sep 24, 2025
… Distros (#135300) (#135362)

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.
elasticsearchmachine pushed a commit that referenced this pull request Sep 24, 2025
… Distros (#135300) (#135360)

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.
elasticsearchmachine pushed a commit that referenced this pull request Sep 24, 2025
… Distros (#135300) (#135361)

Bundled OpenJDK 17 is incompatible with newer versions of Ubuntu 24.04 (Kernel 6.14.x).
We fix our bwc testing on ubuntu 24.04 to explicitly use adoptium jdk 17 in cases where the bundled JDK is
older than 21 which is not affected.
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Sep 25, 2025
…fallback

In elastic#135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.
breskeby added a commit that referenced this pull request Sep 25, 2025
…fallback (#135399)

In #135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Sep 25, 2025
…fallback (elastic#135399)

In elastic#135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Sep 25, 2025
…fallback (elastic#135399)

In elastic#135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.

(cherry picked from commit 6047a74)

# Conflicts:
#	test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Sep 25, 2025
…fallback (elastic#135399)

In elastic#135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.

(cherry picked from commit 6047a74)

# Conflicts:
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java
breskeby added a commit to breskeby/elasticsearch that referenced this pull request Sep 25, 2025
…fallback (elastic#135399)

In elastic#135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.

(cherry picked from commit 6047a74)

# Conflicts:
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java
#	test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java
elasticsearchmachine pushed a commit that referenced this pull request Sep 25, 2025
…g jdk fallback (#135399) (#135404)

* [CI] Handle git snapshot BWC versions correctly when calculating jdk fallback (#135399)

In #135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.

* fix typo
breskeby added a commit that referenced this pull request Sep 25, 2025
…g jdk fallback (#135399) (#135410)

* [CI] Handle git snapshot BWC versions correctly when calculating jdk fallback (#135399)

In #135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.

(cherry picked from commit 6047a74)

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

* Fix typo
breskeby added a commit that referenced this pull request Sep 25, 2025
…ng jdk fallback (#135399) (#135411)

* [CI] Handle git snapshot BWC versions correctly when calculating jdk fallback (#135399)

In #135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.

(cherry picked from commit 6047a74)

# Conflicts:
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java

* Fix typo
breskeby added a commit that referenced this pull request Sep 25, 2025
…ng jdk fallback (#135399) (#135412)

* [CI] Handle git snapshot BWC versions correctly when calculating jdk fallback (#135399)

In #135300 we introduced a fallback to
use adoptopenjdk17 when running bwc tests with older distributions.
This fix handles the calculation of overriding requirement by taken 0.0.0 version into account
which is used to represent versions representing git snapshots.

(cherry picked from commit 6047a74)

# Conflicts:
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java
#	test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java

* [CI] Auto commit changes from spotless

* Fix typo

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v8.18.8 v8.19.5 v9.0.8 v9.1.5 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants