You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/07/27 05:49:48 UTC

[GitHub] [kafka] guozhangwang opened a new pull request #9084: MINOR: Preserve Kafka exception from RebalanceListener [Do Not Merge]

guozhangwang opened a new pull request #9084:
URL: https://github.com/apache/kafka/pull/9084


   Some of the rebalance listener may be implemented by Kafka as well, e.g. Connect and Streams, and if the exception thrown is actually a KafkaException, then we should not wrap it but directly throw the exception from the listener.
   
   Unit tests to be added; cc @abbccdda to review.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] guozhangwang commented on pull request #9084: MINOR: Preserve Kafka exception from RebalanceListener [Do Not Merge]

Posted by GitBox <gi...@apache.org>.
guozhangwang commented on pull request #9084:
URL: https://github.com/apache/kafka/pull/9084#issuecomment-664698317


   @abbccdda The exception is thrown from the consumer.poll, and the caller of the consumer could be expecting specific exceptions, e.g. TaskMigratedException will be handled specifically in Streams, but a general KafkaException would be treated as a fatal error.
   
   We're already doing this e.g. in ConsumerCoordinator line 432, but it is not done in all occasions, so I'm just trying to make the behavior to be consistent across all callers here.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] guozhangwang commented on pull request #9084: MINOR: Preserve Kafka exception from RebalanceListener

Posted by GitBox <gi...@apache.org>.
guozhangwang commented on pull request #9084:
URL: https://github.com/apache/kafka/pull/9084#issuecomment-709448776






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] abbccdda commented on a change in pull request #9084: MINOR: Preserve Kafka exception from RebalanceListener [Do Not Merge]

Posted by GitBox <gi...@apache.org>.
abbccdda commented on a change in pull request #9084:
URL: https://github.com/apache/kafka/pull/9084#discussion_r460671888



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
##########
@@ -728,7 +728,11 @@ protected void onJoinPrepare(int generation, String memberId) {
         subscriptions.resetGroupSubscription();
 
         if (exception != null) {
-            throw new KafkaException("User rebalance callback throws an error", exception);
+            if (exception instanceof KafkaException) {
+                throw (KafkaException) exception;

Review comment:
       Why do we need this cast?




----------------------------------------------------------------
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:
users@infra.apache.org