Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .buildkite/linux_jdk_matrix_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,8 @@ steps:
value: "adoptiumjdk_11"
- label: "OpenJDK 21"
value: "openjdk_21"
- label: "OpenJDK 17"
value: "openjdk_17"
- label: "OpenJDK 11"
value: "openjdk_11"
- label: "Zulu 21"
value: "zulu_21"
- label: "Zulu 17"
value: "zulu_17"
- label: "Zulu 11"
value: "zulu_11"

- wait: ~
if: build.source != "schedule" && build.source != "trigger_job"
Expand Down
12 changes: 0 additions & 12 deletions .buildkite/windows_jdk_matrix_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,10 @@ steps:
options:
- label: "Adoptium JDK 21 (Eclipse Temurin)"
value: "adoptiumjdk_21"
- label: "Adoptium JDK 17 (Eclipse Temurin)"
value: "adoptiumjdk_17"
- label: "Adoptium JDK 11 (Eclipse Temurin)"
value: "adoptiumjdk_11"
- label: "OpenJDK 21"
value: "openjdk_21"
- label: "OpenJDK 17"
value: "openjdk_17"
- label: "OpenJDK 11"
value: "openjdk_11"
- label: "Zulu 21"
value: "zulu_21"
- label: "Zulu 17"
value: "zulu_17"
- label: "Zulu 11"
value: "zulu_11"

- wait: ~
if: build.source != "schedule" && build.source != "trigger_job"
Expand Down
7 changes: 6 additions & 1 deletion config/jvm.options
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,9 @@
#
# Sets the maximum nesting depth. The depth is a count of objects and arrays that have not
# been closed, `{` and `[` respectively.
#-Dlogstash.jackson.stream-read-constraints.max-nesting-depth=1000
#-Dlogstash.jackson.stream-read-constraints.max-nesting-depth=1000

# Bypass JDK version check
#
# Setting this to true permit to run Logstash with an unsupported JDK version.
#-Dlogstash.jdk.force=true
18 changes: 15 additions & 3 deletions logstash-core/lib/logstash/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,24 @@ def execute
deprecation_logger.deprecated msg
end

jvmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments()
if JavaVersion::CURRENT < JavaVersion::JAVA_11
logger.warn I18n.t("logstash.runner.java.version",
:java_home => java.lang.System.getProperty("java.home"))
elsif JavaVersion::CURRENT < JavaVersion::JAVA_17
deprecation_logger.deprecated I18n.t("logstash.runner.java.version_17_minimum",
:java_home => java.lang.System.getProperty("java.home"))
elsif JavaVersion::CURRENT < JavaVersion::JAVA_21
deprecation_logger.deprecated I18n.t("logstash.runner.java.version_21_minimum",
:java_home => java.lang.System.getProperty("java.home"))
if force_jdk_check(jvmArgs)
logger.warn I18n.t("logstash.runner.java.version_below_21_force",
:java_home => java.lang.System.getProperty("java.home"),
:java_version => JavaVersion::CURRENT)
else
logger.error I18n.t("logstash.runner.java.version_21_minimum",
:java_home => java.lang.System.getProperty("java.home"),
:java_version => JavaVersion::CURRENT)
return 1
end
end

logger.warn I18n.t("logstash.runner.java.home") if ENV["JAVA_HOME"]
Expand All @@ -350,7 +359,6 @@ def execute
end

logger.info("Starting Logstash", "logstash.version" => LOGSTASH_VERSION, "jruby.version" => RUBY_DESCRIPTION)
jvmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments()
logger.info "JVM bootstrap flags: #{jvmArgs}"

# Add local modules to the registry before everything else
Expand Down Expand Up @@ -650,4 +658,8 @@ def configure_pipeline_buffer_type
end
end

def force_jdk_check(jvm_args_list)
jvm_args_list.include? "-Dlogstash.jdk.force=true"
end
private :force_jdk_check
end
11 changes: 9 additions & 2 deletions logstash-core/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,15 @@ en:
The bundled JDK has been verified to work with each specific version of Logstash, and generally provides best performance and reliability.
If you have compelling reasons for using your own JDK (organizational-specific compliance requirements, for example), the version you supply with LS_JAVA_HOME must meet the minimum requirements.
version_21_minimum: >-
Java 17 is deprecated and in a future release the minimum required version of Java will be Java 21;
your Java version from `%{java_home}` does not meet this requirement.
Starting from Logstash 8.19.19 the minimum required version of Java is 21;
your Java version from `%{java_home}` is `%{java_version}` and does not meet this requirement.
Running Logstash with the bundled JDK is recommended.
The bundled JDK has been verified to work with each specific version of Logstash, and generally provides best performance and reliability.
If you have compelling reasons for using your own JDK (organizational-specific compliance requirements, for example), the version you supply with LS_JAVA_HOME must meet the minimum requirements.
version_below_21_force: >-
Starting from Logstash 8.19.19 the minimum required version of Java is 21;
your Java version from `%{java_home}` is `%{java_version}` and does not meet this requirement.
You have selected to force the execution with unsupported Java version, and could generate unexpected malfunctions.
Running Logstash with the bundled JDK is recommended.
The bundled JDK has been verified to work with each specific version of Logstash, and generally provides best performance and reliability.
If you have compelling reasons for using your own JDK (organizational-specific compliance requirements, for example), the version you supply with LS_JAVA_HOME must meet the minimum requirements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* Helper class to compare current version of JVM with a target version.
Expand Down Expand Up @@ -84,4 +85,9 @@ private static int compare(final JavaVersion leftVersion, final JavaVersion righ
public int compareTo(JavaVersion other) {
return compare(this, other);
}

@Override
public String toString() {
return version.stream().map(Object::toString).collect(Collectors.joining("."));
}
}
Loading