From c2f528e5a452cd7a27ac70da42d21656b8fc7dc2 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Tue, 14 May 2024 21:13:52 +0200 Subject: [PATCH] Check REST test nodes LeakTracker like we check Netty's LeakDetector (#108540) We should make sure to find leaks reported by both of these, these days our `LeakTracker` will likely be more sensitive that Netty's in some cases since our objects refer to Netty objects and thus get collected first. --- .../gradle/testclusters/ElasticsearchNode.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index 31e1cb882305..999f27a646b1 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -1107,11 +1107,11 @@ public class ElasticsearchNode implements TestClusterConfiguration { return; } - boolean foundNettyLeaks = false; + boolean foundLeaks = false; for (String logLine : errorsAndWarnings.keySet()) { - if (logLine.contains("ResourceLeakDetector]")) { + if (logLine.contains("ResourceLeakDetector") || logLine.contains("LeakTracker")) { tailLogs = true; - foundNettyLeaks = true; + foundLeaks = true; break; } } @@ -1140,8 +1140,8 @@ public class ElasticsearchNode implements TestClusterConfiguration { }); } } - if (foundNettyLeaks) { - throw new TestClustersException("Found Netty ByteBuf leaks in node logs."); + if (foundLeaks) { + throw new TestClustersException("Found resource leaks in node logs."); } }