storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/6] storm git commit: STORM-3166: Make Utils.threadDump account for threads dying before it can get the ThreadInfo
Date Fri, 03 Aug 2018 15:41:52 GMT
Repository: storm
Updated Branches:
  refs/heads/master aff667643 -> 674a7cb4a


STORM-3166: Make Utils.threadDump account for threads dying before it can get the ThreadInfo


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/eb7924a5
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/eb7924a5
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/eb7924a5

Branch: refs/heads/master
Commit: eb7924a5c754e04566d6f64d57a2bc1910cac282
Parents: 146beff
Author: Stig Rohde Døssing <srdo@apache.org>
Authored: Wed Aug 1 15:11:28 2018 +0200
Committer: Stig Rohde Døssing <srdo@apache.org>
Committed: Wed Aug 1 15:11:28 2018 +0200

----------------------------------------------------------------------
 storm-client/src/jvm/org/apache/storm/utils/Utils.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/eb7924a5/storm-client/src/jvm/org/apache/storm/utils/Utils.java
----------------------------------------------------------------------
diff --git a/storm-client/src/jvm/org/apache/storm/utils/Utils.java b/storm-client/src/jvm/org/apache/storm/utils/Utils.java
index 8089c77..5594039 100644
--- a/storm-client/src/jvm/org/apache/storm/utils/Utils.java
+++ b/storm-client/src/jvm/org/apache/storm/utils/Utils.java
@@ -1187,6 +1187,10 @@ public class Utils {
         final java.lang.management.ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
         final java.lang.management.ThreadInfo[] threadInfos = threadMXBean.getThreadInfo(threadMXBean.getAllThreadIds(),
100);
         for (java.lang.management.ThreadInfo threadInfo : threadInfos) {
+            if (threadInfo == null) {
+                //Thread died before we could get the info, skip
+                continue;
+            }
             dump.append('"');
             dump.append(threadInfo.getThreadName());
             dump.append("\" ");


Mime
View raw message