Skip to content

Add zookeeper client's timeout in config#325

Open
MedvedewEM wants to merge 1 commit into
mainfrom
zookeeper_timeout_config
Open

Add zookeeper client's timeout in config#325
MedvedewEM wants to merge 1 commit into
mainfrom
zookeeper_timeout_config

Conversation

@MedvedewEM
Copy link
Copy Markdown
Contributor

@MedvedewEM MedvedewEM commented May 21, 2026

Add zookeeper client's timeout in config

Summary by Sourcery

Enhancements:

  • Introduce a default timeout value in the Zookeeper configuration and pass it through to the underlying Kazoo client.

@MedvedewEM MedvedewEM requested a review from aalexfvk May 21, 2026 09:09
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 21, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a configurable ZooKeeper client timeout to the backup configuration and propagates it to the Kazoo client initialization.

File-Level Changes

Change Details Files
Add default ZooKeeper client timeout option to backup configuration.
  • Extend default ZooKeeper configuration dict with a new timeout field set to 10 seconds.
  • Keep existing connect_timeout and other ZooKeeper config fields unchanged.
ch_backup/config.py
Pass configured ZooKeeper timeout through to KazooClient on initialization.
  • Update ZookeeperClient constructor to pass the timeout value from the config dict into KazooClient.
  • Use config.get to keep the timeout parameter optional and backward compatible with existing configs.
ch_backup/zookeeper/zookeeper.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@MedvedewEM MedvedewEM marked this pull request as ready for review May 22, 2026 09:24
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The new timeout option sits alongside an existing connect_timeout config value; consider clarifying the naming (e.g., session_timeout vs connect_timeout) or wiring both through to the Kazoo client to avoid confusion about which timeout controls what.
  • In ZookeeperClient.__init__, using timeout=config['timeout'] instead of config.get('timeout') would ensure the default from ch_backup/config.py is always applied rather than silently falling back to Kazoo’s internal default when the key is absent.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `timeout` option sits alongside an existing `connect_timeout` config value; consider clarifying the naming (e.g., `session_timeout` vs `connect_timeout`) or wiring both through to the Kazoo client to avoid confusion about which timeout controls what.
- In `ZookeeperClient.__init__`, using `timeout=config['timeout']` instead of `config.get('timeout')` would ensure the default from `ch_backup/config.py` is always applied rather than silently falling back to Kazoo’s internal default when the key is absent.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant