diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index 5f06e7b5f..531c1072a 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -1070,16 +1070,6 @@ def _message_generator(self): # like heartbeats, auto-commits, and metadata refreshes timeout_at = self._next_timeout() - # Because the consumer client poll does not sleep unless blocking on - # network IO, we need to explicitly sleep when we know we are idle - # because we haven't been assigned any partitions to fetch / consume - if self._use_consumer_group() and not self.assignment(): - sleep_time = max(timeout_at - time.time(), 0) - if sleep_time > 0 and not self._client.in_flight_request_count(): - log.debug('No partitions assigned; sleeping for %s', sleep_time) - time.sleep(sleep_time) - continue - # Short-circuit the fetch iterator if we are already timed out # to avoid any unintentional interaction with fetcher setup if time.time() > timeout_at: