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

Commit 9ae97cb

Browse files
committed
Merge pull request #516 from Parsely/bugfix/illegalgeneration_handler
handle IllegalGeneration in SimpleConsumer
2 parents f001ccb + 10cfb5d commit 9ae97cb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pykafka/simpleconsumer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
ConsumerStoppedException, KafkaException,
3737
NotLeaderForPartition, OffsetRequestFailedError,
3838
RequestTimedOut, UnknownMemberId, RebalanceInProgress,
39-
ERROR_CODES)
39+
IllegalGeneration, ERROR_CODES)
4040
from .protocol import (PartitionFetchRequest, PartitionOffsetCommitRequest,
4141
PartitionOffsetFetchRequest, PartitionOffsetRequest)
4242
from .utils.error_handlers import (handle_partition_responses, raise_error,
@@ -281,6 +281,9 @@ def _handle_NotLeaderForPartition(parts):
281281
def _handle_GroupLoadInProgress(parts):
282282
log.info("Continuing in response to GroupLoadInProgress")
283283

284+
def _handle_IllegalGeneration(parts):
285+
log.info("Continuing in response to IllegalGeneration")
286+
284287
def _handle_UnknownMemberId(parts):
285288
log.info("Continuing in response to UnknownMemberId")
286289

@@ -296,7 +299,8 @@ def _handle_RebalanceInProgress(parts):
296299
RequestTimedOut.ERROR_CODE: _handle_RequestTimedOut,
297300
GroupLoadInProgress.ERROR_CODE: _handle_GroupLoadInProgress,
298301
UnknownMemberId.ERROR_CODE: _handle_UnknownMemberId,
299-
RebalanceInProgress.ERROR_CODE: _handle_RebalanceInProgress
302+
RebalanceInProgress.ERROR_CODE: _handle_RebalanceInProgress,
303+
IllegalGeneration.ERROR_CODE: _handle_IllegalGeneration
300304
}
301305

302306
def _discover_group_coordinator(self):

0 commit comments

Comments
 (0)