diff --git a/aiokafka/coordinator/assignors/sticky/sticky_assignor.py b/aiokafka/coordinator/assignors/sticky/sticky_assignor.py index 6231bbd8..c0462ce1 100644 --- a/aiokafka/coordinator/assignors/sticky/sticky_assignor.py +++ b/aiokafka/coordinator/assignors/sticky/sticky_assignor.py @@ -557,9 +557,11 @@ def _perform_reassignments( ) # the partition must have a current consumer consumer = self.current_partition_consumer.get(partition) - assert ( - consumer is not None - ), f"Expected partition {partition!r} to be assigned to a consumer" + if consumer is None: + log.error( + "Expected partition %r to be assigned to a consumer", partition + ) + continue if ( partition in self.previous_assignment