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 386 forks source link

fix(core): prefer use of `time.monotonic` #742

Closed StephenSorriaux closed 7 months ago

StephenSorriaux commented 7 months ago

Fixes #722

Why is this needed?

time.time() is subject to changes in system local time and can trigger unexpected behavior. Prefer the use of time.monotonic instead of time.time since we are not making use of the actual time, only an amount of time elapsed.

Proposed Changes

Does this PR introduce any breaking change?

No