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
6 changes: 3 additions & 3 deletions kafka/consumer/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _raise_if_offset_out_of_range(self):
current_out_of_range_partitions = {}

# filter only the fetchable partitions
for partition, offset in self._offset_out_of_range_partitions:
for partition, offset in six.iteritems(self._offset_out_of_range_partitions):
if not self._subscriptions.is_fetchable(partition):
log.debug("Ignoring fetched records for %s since it is no"
" longer fetchable", partition)
Expand Down Expand Up @@ -740,12 +740,12 @@ def _handle_fetch_response(self, request, send_time, response):
self._client.cluster.request_update()
elif error_type is Errors.OffsetOutOfRangeError:
fetch_offset = fetch_offsets[tp]
log.info("Fetch offset %s is out of range for topic-partition %s", fetch_offset, tp)
if self._subscriptions.has_default_offset_reset_policy():
self._subscriptions.need_offset_reset(tp)
log.info("Resetting offset for topic-partition %s", tp)
else:
self._offset_out_of_range_partitions[tp] = fetch_offset
log.info("Fetch offset %s is out of range, resetting offset",
fetch_offset)
elif error_type is Errors.TopicAuthorizationFailedError:
log.warn("Not authorized to read from topic %s.", tp.topic)
self._unauthorized_topics.add(tp.topic)
Expand Down