Skip to content

Commit

Permalink
[kafka check] Handle errors getting producer offset (#12648)
Browse files Browse the repository at this point in the history
  • Loading branch information
piochelepiotr authored Aug 2, 2022
1 parent e66571d commit 39aa394
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def _report_consumer_offsets_and_lag(self, contexts_limit):
if reported_contexts >= contexts_limit:
continue
timestamps = self._broker_timestamps["{}_{}".format(topic, partition)]
# producer_timestamp is set in the same check, so it should never be None
producer_timestamp = timestamps[producer_offset]
# The producer timestamp can be not set if there was an error fetching broker offsets.
producer_timestamp = timestamps.get(producer_offset, None)
consumer_timestamp = self._get_interpolated_timestamp(timestamps, consumer_offset)
if consumer_timestamp is None or producer_timestamp is None:
continue
Expand Down

0 comments on commit 39aa394

Please sign in to comment.