JDK 21 move
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 finalthreadIdhttps://bugs.openjdk.org/browse/JDK-8017617 - Verify the warnings "this-escape" when a constructor use other method or pass around
thisreference 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 GCMX 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
Quality Gate passed
The SonarQube Quality Gate passed, but some issues were introduced.
5 New issues
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code
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.
Quality Gate passed
Kudos, no new issues were introduced!
0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Quality Gate passed
Kudos, no new issues were introduced!
0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
:green_heart: Build Succeeded
- Buildkite Build
- Commit: f45aa3e080b329e171b026efeedeb51dec8c6f37
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