ibessonov commented on code in PR #7910:
URL: https://github.com/apache/ignite-3/pull/7910#discussion_r3038881640


##########
modules/core/src/main/java/org/apache/ignite/internal/thread/ThreadUtils.java:
##########
@@ -53,6 +53,38 @@ public class ThreadUtils {
     /** System line separator. */
     private static final String NL = System.lineSeparator();
 
+    /**
+     * Performs thread dump and prints all available info to the given log 
with {@code WARN} or {@code ERROR} logging level depending on
+     * {@code isErrorLevel} parameter. If there's no thread with a given ID, 
or ID is invalid, then nothing is printed.
+     *
+     * @param log Logger.
+     * @param threadId ID of a thread to dump.
+     * @param isErrorLevel {@code true} if thread dump must be printed with 
{@code ERROR} logging level, {@code false} if thread dump must
+     *      be printed with {@code WARN} logging level.
+     */
+    public static void dumpThread(IgniteLogger log, long threadId, boolean 
isErrorLevel) {
+        if (threadId <= 0) {
+            return;
+        }
+
+        // We don't really need a full stack, and shorter trace should be less 
disruptive I think.
+        int maxStackElements = 15;

Review Comment:
   I have no information on hands, this was simply a precaution. I'll use 64, 
this should be enough



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to