Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #753 from iciclespider/master
Browse files Browse the repository at this point in the history
Update simpleconsumer.py
  • Loading branch information
Emmett J. Butler committed Dec 18, 2017
2 parents db568a7 + 25d3944 commit 5122395
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pykafka/simpleconsumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def _handle_success(parts):

success_responses.extend([(op.partition.id, r)
for op, r in parts_by_error.get(0, [])])
if len(parts_by_error) == 1 and 0 in parts_by_error:
if len(reqs) == 0 or (len(parts_by_error) == 1 and 0 in parts_by_error):
return success_responses
log.error("Error fetching offsets for topic '%s' (errors: %s)",
self._topic.name,
Expand All @@ -600,9 +600,7 @@ def _handle_success(parts):
to_retry = [pair for err in itervalues(parts_by_error) for pair in err]
reqs = [p.build_offset_fetch_request() for p, _ in to_retry]

if len(parts_by_error) > 0:
raise KafkaException(parts_by_error)
return success_responses
raise KafkaException(parts_by_error)

def reset_offsets(self, partition_offsets=None):
"""Reset offsets for the specified partitions
Expand Down

0 comments on commit 5122395

Please sign in to comment.