You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by rh...@apache.org on 2019/05/30 19:02:42 UTC

[kafka] branch 2.2 updated: KAFKA-8418: Wait until REST resources are loaded when starting a Connect Worker. (#6840)

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

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


The following commit(s) were added to refs/heads/2.2 by this push:
     new 46f59e7  KAFKA-8418: Wait until REST resources are loaded when starting a Connect Worker. (#6840)
46f59e7 is described below

commit 46f59e73319b5ee8fa89fb23807a7eb65aa1a631
Author: Alex Diachenko <sa...@gmail.com>
AuthorDate: Thu May 30 12:01:00 2019 -0700

    KAFKA-8418: Wait until REST resources are loaded when starting a Connect Worker. (#6840)
    
    Author: Alex Diachenko <sa...@gmail.com>
    Reviewers: Arjun Satish <ar...@confluent.io>, Konstantine Karantasis <ko...@confluent.io>, Randall Hauch <rh...@gmail.com>
---
 tests/kafkatest/services/connect.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tests/kafkatest/services/connect.py b/tests/kafkatest/services/connect.py
index afd2bff..96e0d54 100644
--- a/tests/kafkatest/services/connect.py
+++ b/tests/kafkatest/services/connect.py
@@ -20,7 +20,6 @@ import signal
 import time
 
 import requests
-from ducktape.cluster.remoteaccount import RemoteCommandError
 from ducktape.errors import DucktapeError
 from ducktape.services.service import Service
 from ducktape.utils.util import wait_until
@@ -107,12 +106,12 @@ class ConnectServiceBase(KafkaPathResolverMixin, Service):
 
     def listening(self, node):
         try:
-            cmd = "nc -z %s %s" % (node.account.hostname, self.CONNECT_REST_PORT)
-            node.account.ssh_output(cmd, allow_fail=False)
-            self.logger.debug("Connect worker started accepting connections at: '%s:%s')", node.account.hostname,
+            self.list_connectors(node)
+            self.logger.debug("Connect worker started serving REST at: '%s:%s')", node.account.hostname,
                               self.CONNECT_REST_PORT)
             return True
-        except (RemoteCommandError, ValueError) as e:
+        except requests.exceptions.ConnectionError:
+            self.logger.debug("REST resources are not loaded yet")
             return False
 
     def start(self, mode=STARTUP_MODE_LISTEN):