You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/11/30 17:18:33 UTC
[GitHub] [hbase] shahrs87 commented on a change in pull request #3866: HBASE-26468 Region Server doesn't exit cleanly incase it crashes.
shahrs87 commented on a change in pull request #3866:
URL: https://github.com/apache/hbase/pull/3866#discussion_r759498176
##########
File path: hbase-common/src/main/java/org/apache/hadoop/hbase/util/Threads.java
##########
@@ -307,4 +308,33 @@ public static synchronized void printThreadInfo(PrintStream stream, String title
throw new RuntimeException(e.getCause());
}
}
+
+ /**
+ * Checks whether any non-daemon thread is running.
+ * @return true if there are non daemon threads running, otherwise false
+ */
+ public static boolean isNonDaemonThreadRunning() {
+ AtomicInteger nonDaemonThreadCount = new AtomicInteger();
+ Set<Thread> threads = Thread.getAllStackTraces().keySet();
+ for (Thread t: threads) {
Review comment:
There is a small difference between master patch and branch-1 patch.
1. Replaced `threads.forEach(t -> {` with `for (Thread t: threads)`
2. Replaced `org.apache.commons.logging.Log` with `org.slf4j.LoggerFactory` since the former doesn't allow String formatter.
Cc @virajjasani
--
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: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org