From aaf61ff89a6476196b50d7549527e82294474696 Mon Sep 17 00:00:00 2001 From: Gabriel Tincu Date: Thu, 19 Mar 2020 20:19:04 +0100 Subject: [PATCH] Update docstring --- kafka/producer/sender.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kafka/producer/sender.py b/kafka/producer/sender.py index 79c7d154c..31e2609ab 100644 --- a/kafka/producer/sender.py +++ b/kafka/producer/sender.py @@ -196,6 +196,7 @@ def _handle_produce_response(self, node_id, send_time, batches, response): for topic, partitions in response.topics: for partition_info in partitions: global_error = None + log_start_offset = None if response.API_VERSION < 2: partition, error_code, offset = partition_info ts = None @@ -208,7 +209,7 @@ def _handle_produce_response(self, node_id, send_time, batches, response): tp = TopicPartition(topic, partition) error = Errors.for_code(error_code) batch = batches_by_partition[tp] - self._complete_batch(batch, error, offset, ts, global_error) + self._complete_batch(batch, error, offset, ts, log_start_offset, global_error) if response.API_VERSION > 0: self._sensors.record_throttle_time(response.throttle_time_ms, node=node_id) @@ -227,6 +228,7 @@ def _complete_batch(self, batch, error, base_offset, timestamp_ms=None, log_star base_offset (int): The base offset assigned to the records if successful timestamp_ms (int, optional): The timestamp returned by the broker for this batch log_start_offset (int): The start offset of the log at the time this produce response was created + global_error (Exception): The summarising error message """ # Standardize no-error to None if error is Errors.NoError: