Skip to content

Commit c7bc3b7

Browse files
authored
Silence time zone ID deprecation warning for JDK 25 due to log4j2 bug. (#134719) (#135020)
Relates to #132035 Relates to ES-12649
1 parent 3af98ba commit c7bc3b7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/ErrorPumpThread.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
import org.elasticsearch.bootstrap.BootstrapInfo;
1313
import org.elasticsearch.cli.Terminal;
1414
import org.elasticsearch.cli.Terminal.Verbosity;
15+
import org.elasticsearch.common.regex.Regex;
1516

1617
import java.io.BufferedReader;
1718
import java.io.Closeable;
1819
import java.io.IOException;
1920
import java.io.InputStream;
2021
import java.io.InputStreamReader;
2122
import java.nio.charset.StandardCharsets;
22-
import java.util.List;
2323
import java.util.concurrent.CountDownLatch;
24+
import java.util.function.Predicate;
2425

2526
import static org.elasticsearch.bootstrap.BootstrapInfo.SERVER_READY_MARKER;
2627
import static org.elasticsearch.server.cli.ProcessUtil.nonInterruptibleVoid;
@@ -84,8 +85,12 @@ void drain() {
8485
nonInterruptibleVoid(this::join);
8586
}
8687

87-
/** List of messages / lines to filter from the output. */
88-
List<String> filter = List.of("WARNING: Using incubator modules: jdk.incubator.vector");
88+
/** Messages / lines predicate to filter from the output. */
89+
private static Predicate<String> filter = Regex.simpleMatcher(
90+
"WARNING: Using incubator modules: jdk.incubator.vector",
91+
// requires log4j2 upgrade, see https://github.com/elastic/elasticsearch/issues/132035
92+
"WARNING: Use of the three-letter time zone ID * is deprecated and it will be removed in a future release"
93+
);
8994

9095
@Override
9196
public void run() {
@@ -95,7 +100,7 @@ public void run() {
95100
if (line.isEmpty() == false && line.charAt(0) == SERVER_READY_MARKER) {
96101
ready = true;
97102
readyOrDead.countDown();
98-
} else if (filter.contains(line) == false) {
103+
} else if (filter.test(line) == false) {
99104
terminal.errorPrintln(Verbosity.SILENT, line, false);
100105
}
101106
}

0 commit comments

Comments
 (0)