Skip to content

timeout param is not respected #753

@rahav

Description

@rahav

Expected Behavior

  1. The default timeout is respected.
  2. If specified, the timeout is respected.

Actual Behavior

The computers on which the 3 ZK servers run are deliberately OFF. Run the client from a forth computer.

In the client code, define 3 hosts in the KazooClient() statement. The start() statement that follows, cycles through the hosts in about 5 seconds per host. Not 10 as expected.

Setting the timeout in the call to KazooClient() or start() does not change this duration.

Snippet to Reproduce the Problem

zk = KazooClient(hosts='rpi17.local:2181,rpi18.local:2181,rpi19.local:2181')   # Adding timeout param does not change behavior
zk.start()`   # or zk.start(timeout=15)

Logs with logging in DEBUG mode

Cannot resolve rpi17.local: [Errno 8] nodename nor servname provided, or not known
Cannot resolve rpi18.local: [Errno 8] nodename nor servname provided, or not known
Cannot resolve rpi19.local: [Errno 8] nodename nor servname provided, or not known
Failed connecting to Zookeeper within the connection retry policy.
Traceback (most recent call last):
File "/Users/Dropbox/Idempotent/ZooKeeper/zkMyCli.py", line 441, in
zk.start(timeout=15)
File "/Users/rahav/anaconda3/lib/python3.11/site-packages/kazoo/client.py", line 669, in start
raise self.handler.timeout_exception("Connection time-out")
kazoo.handlers.threading.KazooTimeoutError: Connection time-out

Specifications

  • Kazoo version: 2.10.0
  • Result of pip list command: kazoo 2.10.0
  • Zookeeper version: 3.8.4
  • Zookeeper configuration:
  • Python version: 3.11.5
  • OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions