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 committed Nov 2, 2022
1 parent 46e56c9 commit 5612e55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ 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 5612e55

Please sign in to comment.