Skip to content

Commit

Permalink
Consider ILLEGAL_GENERATION error as rebalancing error
Browse files Browse the repository at this point in the history
This error is indicating that the consumer is trying to commit
offsets, but the consumer group has changed to a new generation.

Retrying within the existing session will indeed not work, but
rejoining the group and re-trying should be successful.

Fixes tulios#1009
  • Loading branch information
jakewins authored and Nevon committed Feb 27, 2023
1 parent dcee697 commit 5ec2806
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ class KafkaJSAggregateError extends Error {
class KafkaJSFetcherRebalanceError extends Error {}

const isRebalancing = e =>
e.type === 'REBALANCE_IN_PROGRESS' || e.type === 'NOT_COORDINATOR_FOR_GROUP'
e.type === 'REBALANCE_IN_PROGRESS' ||
e.type === 'NOT_COORDINATOR_FOR_GROUP' ||
e.type === 'ILLEGAL_GENERATION'

const isKafkaJSError = e => e instanceof KafkaJSError

Expand Down

0 comments on commit 5ec2806

Please sign in to comment.