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

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


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

commit 126916b4e1b9b6a419aa2b55776c44fcbf57c71b
Author: Alex Diachenko <sansanic...@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 <sansanic...@gmail.com>
    Reviewers: Arjun Satish <ar...@confluent.io>, Konstantine Karantasis 
<konstant...@confluent.io>, Randall Hauch <rha...@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):

Reply via email to