From 435c6d50953befe0d354fee4971865ba1495a308 Mon Sep 17 00:00:00 2001 From: Moritz Mack Date: Thu, 18 Sep 2025 18:04:06 +0200 Subject: [PATCH] Silence time zone ID deprecation warning for JDK 25 due to log4j2 bug. (#134719) Relates to #132035 Relates to ES-12649 --- .../elasticsearch/server/cli/ErrorPumpThread.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/ErrorPumpThread.java b/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/ErrorPumpThread.java index 2e1d9ea3f2fe2..1498fc8ae86dc 100644 --- a/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/ErrorPumpThread.java +++ b/distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/ErrorPumpThread.java @@ -12,6 +12,7 @@ import org.elasticsearch.bootstrap.BootstrapInfo; import org.elasticsearch.cli.Terminal; import org.elasticsearch.cli.Terminal.Verbosity; +import org.elasticsearch.common.regex.Regex; import java.io.BufferedReader; import java.io.Closeable; @@ -19,8 +20,8 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; -import java.util.List; import java.util.concurrent.CountDownLatch; +import java.util.function.Predicate; import static org.elasticsearch.bootstrap.BootstrapInfo.SERVER_READY_MARKER; import static org.elasticsearch.server.cli.ProcessUtil.nonInterruptibleVoid; @@ -84,8 +85,12 @@ void drain() { nonInterruptibleVoid(this::join); } - /** List of messages / lines to filter from the output. */ - List filter = List.of("WARNING: Using incubator modules: jdk.incubator.vector"); + /** Messages / lines predicate to filter from the output. */ + private static Predicate filter = Regex.simpleMatcher( + "WARNING: Using incubator modules: jdk.incubator.vector", + // requires log4j2 upgrade, see https://github.com/elastic/elasticsearch/issues/132035 + "WARNING: Use of the three-letter time zone ID * is deprecated and it will be removed in a future release" + ); @Override public void run() { @@ -95,7 +100,7 @@ public void run() { if (line.isEmpty() == false && line.charAt(0) == SERVER_READY_MARKER) { ready = true; readyOrDead.countDown(); - } else if (filter.contains(line) == false) { + } else if (filter.test(line) == false) { terminal.errorPrintln(Verbosity.SILENT, line, false); } }