Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions kafka/consumer/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,13 @@ def _send_list_offsets_requests(self, timestamps):
for partition, timestamp in six.iteritems(timestamps):
node_id = self._client.cluster.leader_for_partition(partition)
if node_id is None:
if partition.topic not in self._client.cluster.topics():
log.warning("Could not lookup offsets for partition %s since no metadata is available for topic. "
"Wait for metadata refresh and try again", partition)
else:
log.warning("Could not lookup offsets for partition %s since no metadata is available for it. "
"Wait for metadata refresh and try again", partition)
self._client.add_topic(partition.topic)
log.debug("Partition %s is unknown for fetching offset,"
" wait for metadata refresh", partition)
return Future().failure(Errors.StaleMetadata(partition))
elif node_id == -1:
log.debug("Leader for partition %s unavailable for fetching "
Expand Down
Loading