Skip to content

Commit 2e80fbb

Browse files
sibiryakovdpkp
authored andcommitted
Fix of exception raise in case of auto_offset_reset is set to None in KafkaConsumer (#860)
1 parent 4acb7f4 commit 2e80fbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kafka/consumer/fetcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,12 @@ def _handle_fetch_response(self, request, send_time, response):
747747
self._client.cluster.request_update()
748748
elif error_type is Errors.OffsetOutOfRangeError:
749749
fetch_offset = fetch_offsets[tp]
750+
log.info("Fetch offset %s is out of range for topic-partition %s", fetch_offset, tp)
750751
if self._subscriptions.has_default_offset_reset_policy():
751752
self._subscriptions.need_offset_reset(tp)
753+
log.info("Resetting offset for topic-partition %s", tp)
752754
else:
753755
self._offset_out_of_range_partitions[tp] = fetch_offset
754-
log.info("Fetch offset %s is out of range, resetting offset",
755-
fetch_offset)
756756
elif error_type is Errors.TopicAuthorizationFailedError:
757757
log.warn("Not authorized to read from topic %s.", tp.topic)
758758
self._unauthorized_topics.add(tp.topic)

0 commit comments

Comments
 (0)