kafka-commits mailing list archives

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

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


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

commit d4aa52b3e8808be0c14628c26ce9f01225685ae9
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 cb8e00d..8eee575 100644
--- a/tests/kafkatest/services/kafka/kafka.py
+++ b/tests/kafkatest/services/kafka/kafka.py
@@ -288,7 +288,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