'Block until the coordinator for this group is known
(and we have an active connection -- java client uses unsent queue).'

def ensure_coordinator_known(self):

    while self.coordinator_unknown():
        if (self.config['api_version'] < (0, 8, 2)):
            self.coordinator_id = self._client.least_loaded_node()
            if (self.coordinator_id is not None):
                self._client.ready(self.coordinator_id)
            continue
        future = self._send_group_coordinator_request()
        self._client.poll(future=future)
        if future.failed():
            if future.retriable():
                if getattr(future.exception, 'invalid_metadata', False):
                    log.debug('Requesting    metadata    for    group    coordinator    request:    %s', future.exception)
                    metadata_update = self._client.cluster.request_update()
                    self._client.poll(future=metadata_update)
                else:
                    time.sleep((self.config['retry_backoff_ms'] / 1000))
            else:
                raise future.exception
