ableegoldman commented on a change in pull request #8445: URL: https://github.com/apache/kafka/pull/8445#discussion_r414900070
########## File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java ########## @@ -1209,9 +1227,18 @@ public void handle(OffsetCommitResponse commitResponse, RequestFuture<Void> futu return; } else if (error == Errors.UNKNOWN_MEMBER_ID || error == Errors.ILLEGAL_GENERATION) { - // need to reset generation and re-join group - resetGenerationOnResponseError(ApiKeys.OFFSET_COMMIT, error); - future.raise(new CommitFailedException()); + log.info("OffsetCommit failed with {}: {}", sentGeneration, error.message()); + + // only need to reset generation and re-join group if generation has not changed; + // otherwise only raise rebalance-in-progress error + if (generationUnchanged()) { + resetGenerationOnResponseError(ApiKeys.OFFSET_COMMIT, error); + future.raise(new CommitFailedException()); + } else { + future.raise(new RebalanceInProgressException("Offset commit cannot be completed since the " + Review comment: @guozhangwang can you elaborate on why we don't just throw `CommitFailedException` here? It seems like it must be the case that the caller is a zombie and should get that exception to alert it, not the `RebalanceInProgressException` which seems to indicate it might be recoverable ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org