0

My configuration:

zookeeper: 3.4.10

os: ubuntu 16.04

python: 2.7

kazoo: 2.3.1

The code I run in IPython: enter image description here

When I restarted zookeeper, with bin/zkServer.sh restart, the shell shows the exception as below:

enter image description here

If I delete the watch and replace with a listener, the listener works well.

I don't know why, and I read the info from google and github/kazoo, but I found no explanation of how to solve the problem.

P.S.: Someone said because the session of the client connection expired and was lost, the session_id is not the same with the retry connection when the zookeeper restarts

paisanco
  • 4,098
  • 6
  • 27
  • 33
Wenbin Du
  • 19
  • 4
  • if I delete the connection.py lines 244: #if header.xid != xid: # raise RuntimeError('xids do not match, expected %r ' # 'received %r', xid, header.xid) then th code run well. – Wenbin Du Jun 09 '17 at 04:31

1 Answers1

2

I believe this is related to a bug that was introduced in 2.3.1 from the following PR: https://github.com/python-zk/kazoo/pull/305

This is being looked into, and may be rolled back. In the meantime, try using a pre 2.3 version of kazoo.

Ben Bangert
  • 6,233
  • 1
  • 21
  • 10