You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ma...@apache.org on 2022/12/01 09:46:54 UTC

[kafka] branch trunk updated: MINOR: try-finally around super call in http.py (#12924)

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/trunk by this push:
     new b2b9ecdd614 MINOR: try-finally around super call in http.py (#12924)
b2b9ecdd614 is described below

commit b2b9ecdd614d228e94dec988ae13a8c40cf6f53d
Author: Stanislav Vodetskyi <49...@users.noreply.github.com>
AuthorDate: Thu Dec 1 01:46:45 2022 -0800

    MINOR: try-finally around super call in http.py (#12924)
    
    
    Reviewers: Daniel Gospodinow <da...@gmail.com>, Ian McDonald <im...@confluent.io>, Manikumar Reddy <ma...@gmail.com>
---
 tests/kafkatest/services/monitor/http.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/tests/kafkatest/services/monitor/http.py b/tests/kafkatest/services/monitor/http.py
index ef74a5e1ac7..aa564fd47c6 100644
--- a/tests/kafkatest/services/monitor/http.py
+++ b/tests/kafkatest/services/monitor/http.py
@@ -94,13 +94,14 @@ class HttpMetricsCollector(object):
         super(HttpMetricsCollector, self).start_node(node)
 
     def stop(self):
-        super(HttpMetricsCollector, self).stop()
-
-        if self._http_metrics_thread:
-            self.logger.debug("Shutting down metrics httpd")
-            self._httpd.shutdown()
-            self._http_metrics_thread.join()
-            self.logger.debug("Finished shutting down metrics httpd")
+        try:
+            super(HttpMetricsCollector, self).stop()
+        finally:
+            if self._http_metrics_thread:
+                self.logger.debug("Shutting down metrics httpd")
+                self._httpd.shutdown()
+                self._http_metrics_thread.join()
+                self.logger.debug("Finished shutting down metrics httpd")
 
     def stop_node(self, node):
         super(HttpMetricsCollector, self).stop_node(node)