From aabc8fc5339d056722dffc67a4fe9c6c7b3bb456 Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Mon, 26 Feb 2018 15:14:08 -0800 Subject: Validate max_records in KafkaConsumer.poll --- kafka/consumer/group.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kafka/consumer/group.py') diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index debbd2d..110df55 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -595,6 +595,8 @@ class KafkaConsumer(six.Iterator): assert timeout_ms >= 0, 'Timeout must not be negative' if max_records is None: max_records = self.config['max_poll_records'] + assert isinstance(max_records, int), 'max_records must be an integer' + assert max_records > 0, 'max_records must be positive' # Poll for new data until the timeout expires start = time.time() -- cgit v1.2.1