Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 6 additions & 5 deletions kafka/consumer/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,11 +821,12 @@ def _parse_fetched_data(self, completed_fetch):
" offset %d to buffered record list", tp,
position)
unpacked = list(self._unpack_message_set(tp, records))
parsed_records = self.PartitionRecords(fetch_offset, tp, unpacked)
last_offset = unpacked[-1].offset
self._sensors.records_fetch_lag.record(highwater - last_offset)
num_bytes = records.valid_bytes()
records_count = len(unpacked)
if unpacked:
parsed_records = self.PartitionRecords(fetch_offset, tp, unpacked)
last_offset = unpacked[-1].offset
self._sensors.records_fetch_lag.record(highwater - last_offset)
num_bytes = records.valid_bytes()
records_count = len(unpacked)
elif records.size_in_bytes() > 0:
# we did not read a single message from a non-empty
# buffer because that message's size is larger than
Expand Down
2 changes: 1 addition & 1 deletion kafka/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.4.7.post3'
__version__ = '1.4.7.post4'