kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch 1.1 updated: MINOR: Add thread dumps if broker node cannot be stopped (#5373)
Date Fri, 20 Jul 2018 18:14:53 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch 1.1
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/1.1 by this push:
     new 62d24d9  MINOR: Add thread dumps if broker node cannot be stopped (#5373)
62d24d9 is described below

commit 62d24d90f4fd4254eaf53a236f17818a1d23c7b9
Author: Arjun Satish <wicknicks@users.noreply.github.com>
AuthorDate: Fri Jul 20 11:10:43 2018 -0700

    MINOR: Add thread dumps if broker node cannot be stopped (#5373)
    
    In system tests, it is useful to have the thread dumps if a broker cannot be stopped using
SIGTERM.
    
    Reviewers: Xavier Léauté <xl+github@xvrl.net>, Ismael Juma <ismael@juma.me.uk>,
Jason Gustafson <jason@confluent.io>
---
 tests/kafkatest/services/kafka/kafka.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tests/kafkatest/services/kafka/kafka.py b/tests/kafkatest/services/kafka/kafka.py
index 22674b9..2eccf5b 100644
--- a/tests/kafkatest/services/kafka/kafka.py
+++ b/tests/kafkatest/services/kafka/kafka.py
@@ -286,7 +286,19 @@ class KafkaService(KafkaPathResolverMixin, JmxMixin, Service):
 
         for pid in pids:
             node.account.signal(pid, sig, allow_fail=False)
-        wait_until(lambda: len(self.pids(node)) == 0, timeout_sec=60, err_msg="Kafka node
failed to stop")
+
+        try:
+            wait_until(lambda: len(self.pids(node)) == 0, timeout_sec=60, err_msg="Kafka
node failed to stop")
+        except Exception:
+            self.thread_dump(node)
+            raise
+
+    def thread_dump(self, node):
+        for pid in self.pids(node):
+            try:
+                node.account.signal(pid, signal.SIGQUIT, allow_fail=True)
+            except:
+                self.logger.warn("Could not dump threads on node")
 
     def clean_node(self, node):
         JmxMixin.clean_node(self, node)


Mime
View raw message