def is_ready(self) -> bool:
        """Must be called only when holding the lock on `condition`"""
        if self._is_ready:
            try:
                self._client._check_cluster_raft_term(self._cluster_id, self._raft_term)
            except StaleEtcdNode:
                self._is_ready = False
                self.kill_stream()
        return self._is_ready
Must be called only when holding the lock on `condition`
patroni/dcs/etcd3.py