Jim Apple has posted comments on this change. ( http://gerrit.cloudera.org:8080/10145 )
Change subject: IMPALA-5392 Added thread stackTrace summary from OpenJDK. ThreadInfo.toString restricts the number of frames to 8. The idea is to keep this configurable. A runtime flag is also available. ...................................................................... Patch Set 2: (12 comments) Thanks for sending this patch! http://gerrit.cloudera.org:8080/#/c/10145/2//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/10145/2//COMMIT_MSG@7 PS2, Line 7: IMPALA-5392 Added thread stackTrace summary from OpenJDK. ThreadInfo.toString restricts the number of frames to 8. The idea is to keep this configurable. A runtime flag is also available. Some formatting notes: The first line starts with "IMPALA-5392: ". Note the colon. Lines in the commit message should be less than 70 characters. There is a red line in gerrit that indicates this. The first paragraph should be only one line, but also less than 70 characters. This can require some word-smithing. Only include on Change-Id. Only include your final commit notes, not intermediate notes like "missed a small detail". http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java File fe/src/main/java/org/apache/impala/common/JniUtil.java: http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@31 PS2, Line 31: import java.lang.management.MonitorInfo; nit: please keep imports in alphabetical order. http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@248 PS2, Line 248: on the implementation nit: on the implementation of what? http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@259 PS2, Line 259: sb This name is a bit opaque. How about "result"? http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@262 PS2, Line 262: if (threadInfo.getLockName() != null) { Of the many methods in https://docs.oracle.com/javase/8/docs/api/java/lang/management/ThreadInfo.html , how did you pick which ones to include here? http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@275 PS2, Line 275: \n This is all output only in HTML, yes, where all white space is equivalent? http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@276 PS2, Line 276: int i = 0; Why not declare this in the next line? http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@278 PS2, Line 278: StackTraceElement ste = stackTrace[i]; ste is used exactly once; no need to declare it rather than just replace its usage on the next line with stackTrace[i]. http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@280 PS2, Line 280: sb.append('\n'); nit: combine with line 279 http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@282 PS2, Line 282: Thread.State ts = threadInfo.getThreadState(); ts is also used only once. http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@296 PS2, Line 296: default: Please add a note explaining why you fall-through here, rather than printing something out for the other Thread.States. http://gerrit.cloudera.org:8080/#/c/10145/2/fe/src/main/java/org/apache/impala/common/JniUtil.java@300 PS2, Line 300: for (MonitorInfo mi : threadInfo.getLockedMonitors()) { I'm not sure what the scale is here, but this is not a great way to check this. If there are N stack frames and M monitor infos, this takes M * N time. -- To view, visit http://gerrit.cloudera.org:8080/10145 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I80ab4aad03e0c1f01fecad6b87779531244c28b7 Gerrit-Change-Number: 10145 Gerrit-PatchSet: 2 Gerrit-Owner: Abhishek Sharma <[email protected]> Gerrit-Reviewer: Alex Behm <[email protected]> Gerrit-Reviewer: Charles Agnello <[email protected]> Gerrit-Reviewer: Jim Apple <[email protected]> Gerrit-Comment-Date: Tue, 24 Apr 2018 00:32:44 +0000 Gerrit-HasComments: Yes
