From bb04376d15965e332e0fdc49dc9ba9a1b9d9cb20 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Thu, 5 Dec 2024 18:35:18 -0500 Subject: [PATCH] Dump hot threads Signed-off-by: Craig Perkins --- .../test/framework/cluster/LocalOpenSearchCluster.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java b/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java index 812ec43fee..acd9e100c7 100644 --- a/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java +++ b/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java @@ -55,6 +55,7 @@ import org.apache.logging.log4j.Logger; import org.opensearch.action.admin.cluster.health.ClusterHealthResponse; +import org.opensearch.action.admin.cluster.node.hotthreads.NodesHotThreadsResponse; import org.opensearch.action.admin.cluster.node.stats.NodeStats; import org.opensearch.action.admin.cluster.node.stats.NodesStatsRequest; import org.opensearch.action.admin.cluster.node.stats.NodesStatsResponse; @@ -254,6 +255,13 @@ public void stop(boolean checkActiveThreads) throws IOException { } } if (threadsActive) { + // TODO Hot Threads added for debugging + NodesHotThreadsResponse hotThreadsResponse = adminClient.cluster().prepareNodesHotThreads().get(); + if (hotThreadsResponse.getNodes().isEmpty()) { + log.warn("Hot threads response is empty"); + break; + } + log.warn("Hot threads stack trace: {}", hotThreadsResponse.getNodes().get(0).getHotThreads()); break; } }