Skip to content

Commit

Permalink
Avoid KeyError when filtering fetchable partitions (#1344)
Browse files Browse the repository at this point in the history
* Avoid KeyError when filtering fetchable partitions
  • Loading branch information
dpkp authored Jan 12, 2018
1 parent a8bf19f commit 298709d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kafka/consumer/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,9 @@ def _handle_offset_response(self, future, response):
def _fetchable_partitions(self):
fetchable = self._subscriptions.fetchable_partitions()
if self._next_partition_records:
fetchable.remove(self._next_partition_records.topic_partition)
fetchable.discard(self._next_partition_records.topic_partition)
for fetch in self._completed_fetches:
fetchable.remove(fetch.topic_partition)
fetchable.discard(fetch.topic_partition)
return fetchable

def _create_fetch_requests(self):
Expand Down

0 comments on commit 298709d

Please # to comment.