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.3k stars 387 forks source link

Lock recipe (at least) makes invalid assumption on Zookeeper sequence numbers #606

Open ceache opened 4 years ago

ceache commented 4 years ago

https://github.com/python-zk/kazoo/blob/b20c929421ff72421ad3770fb3436d583df5e5b0/kazoo/recipe/lock.py#L286

This assumption badly broken. Sequence numbers are signed 32bit wrapping numbers.

https://zookeeper.apache.org/doc/r3.6.0/zookeeperProgrammers.html#Sequence+Nodes+--+Unique+Naming

The proper way to handle them is to use SNA