Bläddra i källkod

TESTS: More Logging in LongGcDisruptionTests (#35702)

* The existing logging is not helpful enough to track down which threads hang, we need the hanging thread's stacktraces too
* Relates #35686
Armin Braun 7 år sedan
förälder
incheckning
33c713ba60

+ 8 - 2
test/framework/src/main/java/org/elasticsearch/test/disruption/LongGCDisruption.java

@@ -103,8 +103,14 @@ public class LongGCDisruption extends SingleNodeDisruption {
                     throw new RuntimeException("unknown error while suspending threads", suspendingError.get());
                 }
                 if (suspendingThread.isAlive()) {
-                    logger.warn("failed to suspend node [{}]'s threads within [{}] millis. Suspending thread stack trace:\n {}"
-                        , disruptedNode, getSuspendingTimeoutInMillis(), stackTrace(suspendingThread.getStackTrace()));
+                    logger.warn(
+                        "failed to suspend node [{}]'s threads within [{}] millis. Suspending thread stack trace:\n {}" +
+                            "\nThreads that weren't suspended:\n {}"
+                        , disruptedNode, getSuspendingTimeoutInMillis(), stackTrace(suspendingThread.getStackTrace()),
+                        suspendedThreads.stream()
+                            .map(t -> t.getName() + "\n----\n" + stackTrace(t.getStackTrace()))
+                            .collect(Collectors.joining("\n"))
+                    );
                     suspendingThread.interrupt(); // best effort;
                     try {
                         /*