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 <[email protected]>
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é <[email protected]>, Ismael Juma
<[email protected]>, Jason Gustafson <[email protected]>
---
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)