def lookup(self, service, timeout=1):
        if self.client.state != KazooState.CONNECTED:
            return service
        service_name = service.name
        result = self.client.get_children_async(
            path='/%s/%s' % (SERVICE_NAMESPACE, service_name, ),
            watch=functools.partial(self.on_service_name_watch, service),
        )
        try:
            instance_ids = result.get(timeout=timeout)
        except NoNodeError:
            raise LookupFailure("failed to resolve %s", service.name)
        except KazooException as e:
            logger.warning("zookeeper lookup failure: %s", e)
            return service
        logger.info("lookup %s %r", service_name, instance_ids)
        old_instance_ids = {instance.id for instance in service}
        for instance_id in instance_ids:
            kwargs = self._get_service_znode(service, service_name, instance_id)
            service.update(instance_id, **kwargs)
            try:
                old_instance_ids.remove(instance_id)
            except __HOLE__:
                pass
        for instance_id in old_instance_ids:
            service.remove(instance_id)
        return service
dataset/ETHPy150Open deliveryhero/lymph/lymph/discovery/zookeeper.py/ZookeeperServiceRegistry.lookup