merlimat closed pull request #1864: Increase watch-znode.py connection timeout
URL: https://github.com/apache/incubator-pulsar/pull/1864
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docker/pulsar/scripts/watch-znode.py 
b/docker/pulsar/scripts/watch-znode.py
index 24ce19ba7d..50753538b8 100755
--- a/docker/pulsar/scripts/watch-znode.py
+++ b/docker/pulsar/scripts/watch-znode.py
@@ -18,8 +18,11 @@
 # under the License.
 #
 
-import sys, getopt, time
+import sys, getopt, time, logging
 from kazoo.client import KazooClient
+from kazoo.retry import KazooRetry
+
+logging.getLogger('kazoo.client').addHandler(logging.StreamHandler())
 
 def usage():
     print >> sys.stderr, "\n%s -z <zookeeper> -p <path> [-w|-c|-e]" % 
(sys.argv[0])
@@ -77,7 +80,7 @@ def usage():
     usage()
     sys.exit(5)
 
-zk = KazooClient(hosts=zookeeper)
+zk = KazooClient(hosts=zookeeper, timeout=1, 
connection_retry=KazooRetry(max_tries=-1))
 zk.start()
 
 if create:


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to