python-zk / kazoo

Kazoo is a high-level Python library that makes it easier to use Apache Zookeeper.
https://kazoo.readthedocs.io
Apache License 2.0
1.29k stars 386 forks source link

xid reach max int 2147483647 #403

Open zhoujh opened 8 years ago

zhoujh commented 8 years ago

Hi , After my application run 5 month , xid reach 2147483647 , I get the error like this: 2016-08-22 11:12:35,210 - kazoo.client - ERROR - Unhandled exception in connection loop Traceback (most recent call last): File "/data/services/proxy/lib/python2.7/site-packages/kazoo/protocol/connection.py", line 541, in _connect_attempt self._send_request(read_timeout, connect_timeout) File "/data/services/proxy/lib/python2.7/site-packages/kazoo/protocol/connection.py", line 445, in _send_request self._submit(request, connect_timeout, xid) File "/data/services/proxy/lib/python2.7/site-packages/kazoo/protocol/connection.py", line 276, in _submit b.extend(int_struct.pack(xid)) error: 'i' format requires -2147483648 <= number <= 2147483647 2016-08-22 11:12:35,244 - kazoo.client - INFO - Zookeeper session lost, state: CLOSED Traceback (most recent call last): ... File "/data/services/proxy/lib/python2.7/site-packages/kazoo/client.py", line 1079, in get_children return self.get_children_async(path, watch, include_data).get() File "/data/services/proxy/lib/python2.7/site-packages/kazoo/handlers/utils.py", line 78, in get raise self._exception ConnectionLoss 2016-08-22 11:12:35,247 - app - ERROR - Traceback (most recent call last): .... File "/data/services/proxy/lib/python2.7/site-packages/kazoo/client.py", line 984, in exists return self.exists_async(path, watch).get() File "/data/services/proxy/lib/python2.7/site-packages/kazoo/handlers/utils.py", line 72, in get raise self._exception ConnectionClosedError: Connection has been closed

it seem that KazooRetry(max_tries=-1, max_delay=1) don't retry for this exception .

is it a bug ?

Python 2.7.10 kazoo-2.2.1

harlowja commented 7 years ago

Probably a bug :)