logstash icon indicating copy to clipboard operation
logstash copied to clipboard

JDK 21 move

Open andsel opened this issue 2 years ago • 4 comments

Release notes

Adaptations to run Logstash on JDK 21

What does this PR do?

Adaptations to JDK 21:

  • Java 8 support is obsolete and will be removed.
  • Thread's getId (not final) replaced by final threadId https://bugs.openjdk.org/browse/JDK-8017617
  • Verify the warnings "this-escape" when a constructor use other method or pass around this reference to other methods https://bugs.openjdk.org/browse/JDK-8015831
  • URL constructor is deprecated, use <uri_instance>.toURL() (since JDK 20)
  • Manages new (since JDK 20) G1 Concurrent GC MX Bean, ref

Why is it important/What is the impact to the user?

As a developer I want that all the blockings to use JDK 21 are removed before effectively switching the bundled JDK to version 21

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have commented my code, particularly in hard-to-understand areas
  • ~~[ ] I have made corresponding changes to the documentation~~
  • ~~[ ] I have made corresponding change to the default configuration files (and/or docker env variables)~~
  • ~~[ ] I have added tests that prove my fix is effective or that my feature works~~

Author's Checklist

  • [x] run Buildkite JDK 21 matrix for this PR: https://buildkite.com/elastic/logstash-linux-jdk-matrix-pipeline/builds/136

How to test this PR locally

Install a JDK 21 on your host, example:

sdk install java 21.0.2-tem

and run some testing, like

./gradlew runIntegrationTests -PrubyIntegrationSpecs="specs/mixed_codec_spec.rb" --console=plain

or if you would run all integration tests:

export BUILD_JAVA_HOME=/<home>/.sdkman/candidates/java/21.0.2-tem && export RUNTIME_JAVA_HOME=/<home>/.sdkman/candidates/java/21.0.2-tem && export LS_JAVA_HOME=/<home>/.sdkman/candidates/java/21.0.2-tem
ci/integration_tests.sh

try also a run of Logstash with LS_JAVA_HOME set to a JDK 21 path.

Related issues

  • Relates #15342
  • Requires #15707

Use cases

Screenshots

Logs

andsel avatar Dec 21 '23 10:12 andsel

Quality Gate passed Quality Gate passed

The SonarQube Quality Gate passed, but some issues were introduced.

5 New issues
0 Security Hotspots
100.0% 100.0% Coverage on New Code
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

elastic-sonarqube[bot] avatar Jan 02 '24 12:01 elastic-sonarqube[bot]

As reported in Oracle blog, a new G1 Concurrent GC JMX Bean is published to track remark and clean phases times spent.

GarbageCollectorMXBean for remark and cleanup pause time in G1. The Garbage-First (G1) garbage collector now has a new GarbageCollectorMXBean called G1 Concurrent GC. This bean reports the duration and occurrence of the remark and cleanup garbage collection pauses.

These pauses occur during a complete concurrent mark cycle, increasing the collection counter by two (one for the remark pause and one for the cleanup pause), similar to the CGC field of the jstat -gcutil command. During these pauses, G1 Concurrent GC also updates the memory pool for the G1 Old Gen MemoryManagerMXBean.

andsel avatar Feb 15 '24 15:02 andsel

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

elastic-sonarqube[bot] avatar Feb 15 '24 16:02 elastic-sonarqube[bot]

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

elastic-sonarqube[bot] avatar Apr 03 '24 14:04 elastic-sonarqube[bot]

:green_heart: Build Succeeded

History

  • :green_heart: Build #994 succeeded 1f5f73572d7ef2c140484c6b9e75dbb8886b08ef
  • :green_heart: Build #992 succeeded 3b520e2839fde8dfb8bad03fca468635403e3e1b
  • :green_heart: Build #987 succeeded e089ae5d19f2d77302783b5ce568453522dd42cb
  • :green_heart: Build #875 succeeded c97e020d6b6f9f92243d04f19eb0afbcbcef99e7
  • :green_heart: Build #874 succeeded 7904dc90379d3a167388e3bf4da62a664f76b64d
  • :green_heart: Build #868 succeeded 4561669adcf5b51da42280cf5beaf9dcb4fa7456

cc @andsel

elasticmachine avatar Apr 03 '24 14:04 elasticmachine