You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Joe McDonnell (Code Review)" <ge...@cloudera.org> on 2023/03/19 21:16:44 UTC

[Impala-ASF-CR] IMPALA-5392: Display full Java stacktraces in /jvm-threadz

Joe McDonnell has uploaded this change for review. ( http://gerrit.cloudera.org:8080/19632


Change subject: IMPALA-5392: Display full Java stacktraces in /jvm-threadz
......................................................................

IMPALA-5392: Display full Java stacktraces in /jvm-threadz

jvm-threadz provides information about all the JVM
threads running in an Impalad/Catalogd. Currently, this
relies on ThreadInfo.toString() for a text representation
of the thread information and stack. This output only contains
the first few frames, which can be an issue for deeper stacks
(e.g. the Catalog talking to HMS via Thrift). The output does
contain useful non-stacktrace information like what lock the
thread is waiting on.

This keeps the first line of the ThreadInfo.toString() output
that contains non-stacktrace information. Then it walks through
the StackTraceElements from ThreadInfo.getStackTrace() and
adds the full stack string. This is intended to mimic
the jstack output (with indentation and "at").

To avoid licensing issues, I have not looked at any of the
OpenJDK code (which is GPL 2.0) or any of the previous attempts
at solving this issue (which consulted OpenJDK code).

To make the stacks display correctly in the WebUI page,
this puts the thread information in a <span> with
"white-space: pre-wrap", which respects the newlines in
the original output.

Testing:
 - gdb attached to the HMS and then issued a select in
   impala-shell to force a metadata load. Then, looked at
   the catalogd /jvm-threadz page to see the longer stacks.

Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
---
M fe/src/main/java/org/apache/impala/common/JniUtil.java
M www/jvm-threadz.tmpl
2 files changed, 18 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/32/19632/1
-- 
To view, visit http://gerrit.cloudera.org:8080/19632
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
Gerrit-Change-Number: 19632
Gerrit-PatchSet: 1
Gerrit-Owner: Joe McDonnell <jo...@cloudera.com>

[Impala-ASF-CR] IMPALA-5392: Display full Java stacktraces in /jvm-threadz

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/19632 )

Change subject: IMPALA-5392: Display full Java stacktraces in /jvm-threadz
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/12647/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


-- 
To view, visit http://gerrit.cloudera.org:8080/19632
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
Gerrit-Change-Number: 19632
Gerrit-PatchSet: 1
Gerrit-Owner: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Sun, 19 Mar 2023 21:37:51 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5392: Display full Java stacktraces in /jvm-threadz

Posted by "Wenzhe Zhou (Code Review)" <ge...@cloudera.org>.
Wenzhe Zhou has posted comments on this change. ( http://gerrit.cloudera.org:8080/19632 )

Change subject: IMPALA-5392: Display full Java stacktraces in /jvm-threadz
......................................................................


Patch Set 1: Code-Review+1


-- 
To view, visit http://gerrit.cloudera.org:8080/19632
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
Gerrit-Change-Number: 19632
Gerrit-PatchSet: 1
Gerrit-Owner: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Comment-Date: Mon, 20 Mar 2023 03:51:58 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5392: Display full Java stacktraces in /jvm-threadz

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/19632 )

Change subject: IMPALA-5392: Display full Java stacktraces in /jvm-threadz
......................................................................


Patch Set 1:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/9156/ DRY_RUN=true


-- 
To view, visit http://gerrit.cloudera.org:8080/19632
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
Gerrit-Change-Number: 19632
Gerrit-PatchSet: 1
Gerrit-Owner: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Comment-Date: Mon, 20 Mar 2023 03:54:01 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5392: Display full Java stacktraces in /jvm-threadz

Posted by "Quanlong Huang (Code Review)" <ge...@cloudera.org>.
Quanlong Huang has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/19632 )

Change subject: IMPALA-5392: Display full Java stacktraces in /jvm-threadz
......................................................................

IMPALA-5392: Display full Java stacktraces in /jvm-threadz

jvm-threadz provides information about all the JVM
threads running in an Impalad/Catalogd. Currently, this
relies on ThreadInfo.toString() for a text representation
of the thread information and stack. This output only contains
the first few frames, which can be an issue for deeper stacks
(e.g. the Catalog talking to HMS via Thrift). The output does
contain useful non-stacktrace information like what lock the
thread is waiting on.

This keeps the first line of the ThreadInfo.toString() output
that contains non-stacktrace information. Then it walks through
the StackTraceElements from ThreadInfo.getStackTrace() and
adds the full stack string. This is intended to mimic
the jstack output (with indentation and "at").

To avoid licensing issues, I have not looked at any of the
OpenJDK code (which is GPL 2.0) or any of the previous attempts
at solving this issue (which consulted OpenJDK code).

To make the stacks display correctly in the WebUI page,
this puts the thread information in a <span> with
"white-space: pre-wrap", which respects the newlines in
the original output.

Testing:
 - gdb attached to the HMS and then issued a select in
   impala-shell to force a metadata load. Then, looked at
   the catalogd /jvm-threadz page to see the longer stacks.

Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
Reviewed-on: http://gerrit.cloudera.org:8080/19632
Reviewed-by: Wenzhe Zhou <wz...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Quanlong Huang <hu...@gmail.com>
---
M fe/src/main/java/org/apache/impala/common/JniUtil.java
M www/jvm-threadz.tmpl
2 files changed, 18 insertions(+), 2 deletions(-)

Approvals:
  Wenzhe Zhou: Looks good to me, but someone else must approve
  Impala Public Jenkins: Verified
  Quanlong Huang: Looks good to me, approved

-- 
To view, visit http://gerrit.cloudera.org:8080/19632
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
Gerrit-Change-Number: 19632
Gerrit-PatchSet: 2
Gerrit-Owner: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>

[Impala-ASF-CR] IMPALA-5392: Display full Java stacktraces in /jvm-threadz

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/19632 )

Change subject: IMPALA-5392: Display full Java stacktraces in /jvm-threadz
......................................................................


Patch Set 1: Verified+1


-- 
To view, visit http://gerrit.cloudera.org:8080/19632
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
Gerrit-Change-Number: 19632
Gerrit-PatchSet: 1
Gerrit-Owner: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Comment-Date: Mon, 20 Mar 2023 09:09:40 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5392: Display full Java stacktraces in /jvm-threadz

Posted by "Quanlong Huang (Code Review)" <ge...@cloudera.org>.
Quanlong Huang has posted comments on this change. ( http://gerrit.cloudera.org:8080/19632 )

Change subject: IMPALA-5392: Display full Java stacktraces in /jvm-threadz
......................................................................


Patch Set 1: Code-Review+1

Thanks for fixing this!


-- 
To view, visit http://gerrit.cloudera.org:8080/19632
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
Gerrit-Change-Number: 19632
Gerrit-PatchSet: 1
Gerrit-Owner: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Comment-Date: Mon, 20 Mar 2023 00:33:04 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5392: Display full Java stacktraces in /jvm-threadz

Posted by "Quanlong Huang (Code Review)" <ge...@cloudera.org>.
Quanlong Huang has posted comments on this change. ( http://gerrit.cloudera.org:8080/19632 )

Change subject: IMPALA-5392: Display full Java stacktraces in /jvm-threadz
......................................................................


Patch Set 1: Code-Review+2

Carrying Wenzhe's +1.


-- 
To view, visit http://gerrit.cloudera.org:8080/19632
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6730336600a8130e6452c682bcf249cac528ceee
Gerrit-Change-Number: 19632
Gerrit-PatchSet: 1
Gerrit-Owner: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Comment-Date: Mon, 20 Mar 2023 10:28:58 +0000
Gerrit-HasComments: No