Avoid to run on JDK < 21 - #19311
Merged
andsel merged 3 commits intoJul 22, 2026
Merged
Conversation
…k with option -Dlogstash.jdk.force
Contributor
🤖 GitHub commentsJust comment with:
|
donoghuc
self-requested a review
July 16, 2026 15:28
Member
|
run exhaustive tests |
donoghuc
requested changes
Jul 17, 2026
donoghuc
left a comment
Member
There was a problem hiding this comment.
Will we need to adjust jdk matrix buildkite tests? For 8.19 we seem to be testing against java 17, i think that we will need to either do the override for now in test? Or should we just stop testing on 17 now?
Member
Author
Member
Author
|
I answered myself, the acceptance tests, run the LS package, which bundles JDK 21 on 8.19, so JDK 17 is used to execute Gradle etc but then when LS process is spawn it runs the JDK 21. |
💚 Build Succeeded
History
cc @andsel |
Member
Author
|
The execution before 88d413b showed the problme: https://buildkite.com/elastic/logstash-linux-jdk-matrix-pipeline/builds/812. @donoghuc fixed please give it another eye if you can. |
donoghuc
approved these changes
Jul 21, 2026
This was referenced Jul 31, 2026
andsel
pushed a commit
that referenced
this pull request
Aug 4, 2026
Reverts addition of `logstash.jdk.force` and all references to it while we figure out the best ergonomics and deprecation path. The behavior should remain the same as in 8.19.19 whereby if a custom jdk 17 is detected a deprecation will be logged and logstash will continue to run normally. Reverts #19311 #19361
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release notes
Checks that the minimum required JDK is verified. Avoid to run on JDK below 21.
What does this PR do?
Updates runner.rb to do a JDK version check. In case the recognised JDK version is below 21 logs an error message and exit.
At the same time permit to manually force the check , reading the
logstash.jdk.forcefrom JVM options. Set-Dlogstash.jdk.force=trueeither inconfig/jvm.optionsorLS_JAVA_OPTSto run Logstash. If this condition is met a warn message is logged and execution proceed as usual.Why is it important/What is the impact to the user?
A user should always use verified and supported JDK version. Starting from
8.19.19the JDK 17 is deprecated and the suggested (and bundled) one is JDK 21. If the user customized his Java, settingLS_JAVA_HOME, to an unsupported version, Logstash stops. This can be manually forced setting-Dlogstash.jdk.force=truein eitherLS_JAVA_OPTSor in theconfig/jvm.options.Checklist
[ ] 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 worksAuthor's Checklist
How to test this PR locally
Verify that with unsupported JDK version, Logstash logs an error and refuse to start.
Verify that with unsupported JDK version AND manually forcing it, Logstash logs a warning and start.
Related issues
Logs
Example execution avoidance:
Example with manual force: