kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ewe...@apache.org
Subject [kafka] branch 0.11.0 updated: MINOR: Cancel port forwarding for HttpMetricsCollector during cleanup
Date Wed, 21 Feb 2018 18:53:38 GMT
This is an automated email from the ASF dual-hosted git repository.

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

The following commit(s) were added to refs/heads/0.11.0 by this push:
     new 4a0d940  MINOR: Cancel port forwarding for HttpMetricsCollector during cleanup
4a0d940 is described below

commit 4a0d940191d1aa73580b2242d5b9b8ea6c02e830
Author: Ewen Cheslack-Postava <me@ewencp.org>
AuthorDate: Wed Feb 21 10:52:27 2018 -0800

    MINOR: Cancel port forwarding for HttpMetricsCollector during cleanup
    Currently port forwarding is setup for HttpMetricsCollector when the Service's start_node
method is called, but not canceled during stop. This hasn't presented a problem so far because
we don't have tests that use this *and* restart the service. However, if a test/service does
that, it will throw an exception since the port is already bound.
    This just does the cleanup when stopping so a subsequent attempt to start again will succeed.
    https://jenkins.confluent.io/job/system-test-kafka-branch-builder/1320 is a test run for
a Test that uses ProducerPerformanceService, which in turn uses HttpMetricsCollector to validate
the change.
    Author: Ewen Cheslack-Postava <me@ewencp.org>
    Reviewers: Ismael Juma <ismael@juma.me.uk>, Apurva Mehta <apurva@confluent.io>
    Closes #4604 from ewencp/cleanup-reverse-port-forward
    (cherry picked from commit da379c95e4e3fe4dbe4d810a27a2d0b821cb2fb1)
    Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
 tests/kafkatest/services/monitor/http.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/kafkatest/services/monitor/http.py b/tests/kafkatest/services/monitor/http.py
index 83324df..88ddb2e 100644
--- a/tests/kafkatest/services/monitor/http.py
+++ b/tests/kafkatest/services/monitor/http.py
@@ -173,6 +173,7 @@ class _ReverseForwarder(object):
         self.logger = logger
         self._node = node
         self._local_port = local_port
+        self._remote_port = remote_port
         self.logger.debug('Forwarding %s port %d to driver port %d', node, remote_port, local_port)
@@ -189,6 +190,7 @@ class _ReverseForwarder(object):
         if self._accept_thread.isAlive():
             raise RuntimeError("Failed to stop reverse forwarder on %s", self._node)
+        self._transport.cancel_port_forward('', self._remote_port)
     def _accept(self):
         while not self._stopping:

To stop receiving notification emails like this one, please contact

View raw message