Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kazoo.recipe.watchers.ChildrenWatch calls _func() with a Boolean value #255

Open
diranged opened this issue Oct 23, 2014 · 0 comments
Open
Labels

Comments

@diranged
Copy link
Contributor

I'm still trying to track down how we go Kazoo to do this (it seems like its related to some kind of connection failure) -- but in Kazoo 2.0+ we're seeing occasional exceptions thrown in our nd_service_registry code when the watcher calls self._func(children) and the passed in children seems to be a bool.

Stack Trace:

Traceback (most recent call last):
  File "/mnt/.venv/lib/python2.7/site-packages/kazoo/recipe/watchers.py", line 333, in _get_children
    result = self._func(children)
  File "/mnt//.venv/lib/python2.7/site-packages/nd_service_registry/watcher.py", line 197, in _update_children
    self._children = sorted(children)
TypeError: 'bool' object is not iterable

Relevant nd_service_Registry code:
https://github.com/Nextdoor/ndserviceregistry/blob/v1.0.0/nd_service_registry/watcher.py#L197

def _update_children(self, children):
        """Function executed by Kazoo upon children changes for a path.

        This function is registered by the _update() method during and is
        executed by Kazoo upon any children changes to a path. Its responsible
        for updating the local list of children for the path, and executing
        the appropriate callbacks.

        args:
            children: The list of children returned by Kazoo
        """
        self._children = sorted(children)
        log.debug('[%s] Children change detected: %s' %
                  (self._path, self._children))
        self._execute_callbacks()

I'm looking at a short-term fix where I just return with a warning if children isn't the list we expect.. but still pretty strange. This seems to happen in conjunction with issue #254.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants