[ https://issues.apache.org/jira/browse/KAFKA-2786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997669#comment-14997669 ]
ASF GitHub Bot commented on KAFKA-2786: --------------------------------------- GitHub user ewencp opened a pull request: https://github.com/apache/kafka/pull/476 KAFKA-2786: Only respond to SinkTask onPartitionsRevoked after the WorkerSinkTask has finished starting up. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ewencp/kafka kafka-2786-on-partitions-assigned-only-after-start Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/476.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #476 ---- ---- > Only invoke SinkTask onPartitionsRevoked and commitOffsets after task has > fully started > --------------------------------------------------------------------------------------- > > Key: KAFKA-2786 > URL: https://issues.apache.org/jira/browse/KAFKA-2786 > Project: Kafka > Issue Type: Bug > Components: copycat > Reporter: Ewen Cheslack-Postava > Assignee: Ewen Cheslack-Postava > Priority: Minor > Fix For: 0.9.0.0 > > > Currently we're invoking task.onPartitionsRevoked and commitOffsets on any > consumer onPartitionsRevoked callback. Since this happens even on the first > rebalance (which is somewhat unexpected given that partitions cannot actually > be revoked at that point), we will not be fully setup in the SinkTask and > this can throw exceptions. > It turns out this is easy to miss for two reasons. First, the code is likely > to throw an exception, but the consumer catches this and handles it. We end > up not missing any important steps as a result. Second, the logging was a bit > screwed up and we weren't getting the full exception stacktrace, just the > toString(), so it was easy to miss that there was a problem. -- This message was sent by Atlassian JIRA (v6.3.4#6332)