KazooClient bug? connection time-out, but not retry another zk server.

192 views
Skip to first unread message

xiaobo lee

unread,
May 14, 2014, 1:42:58 AM5/14/14
to pyth...@googlegroups.com
My question is that: 
when client connect to yahoo.com:80, there is a timeout exception was throwed,  But it didn't retry connect to 127.0.0.1:2181( this is my real zk server).  Anybody can help me?  thanks.

source code:
=========================
import logging
logging.basicConfig(level=logging.DEBUG)
from kazoo.client import KazooClient
from kazoo.retry import KazooRetry
_retry = KazooRetry(max_tries=1000, delay=0.5, backoff=2)
_zk = KazooClient(hosts="yahoo.com:80,127.0.0.1:2181", logger=logging, read_only=True, timeout=30, connection_retry=_retry)
_zk.start()
_zk.stop()
===========================
log:

DEBUG:root:ZK loop started
DEBUG:root:Skipping state change
INFO:root:Connecting to yahoo.com:80
DEBUG:root:    Using session_id: None session_passwd: 00000000000000000000000000000000
INFO:root:Sending request(xid=None): Connect(protocol_version=0, last_zxid_seen=0, time_out=30000, session_id=0, passwd='\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', read_only=True)
WARNING:root:Connection dropped: socket connection broken
DEBUG:root:Connection stopped
Traceback (most recent call last):
  File "/tmp/1.py", line 7, in <module>
    _zk.start()
  File "/home/s/apps/wdshopping/python/lib/python2.7/site-packages/kazoo-1.2.1-py2.7.egg/kazoo/client.py", line 476, in start
    raise self.handler.timeout_exception("Connection time-out")
kazoo.handlers.threading.TimeoutError: Connection time-out
==============================


Reply all
Reply to author
Forward
0 new messages