Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-4510: StreamThread must finish rebalance in state PENDING_SHUTDOWN #2227

Closed

Conversation

mjsax
Copy link
Member

@mjsax mjsax commented Dec 7, 2016

No description provided.

@mjsax
Copy link
Member Author

mjsax commented Dec 7, 2016

@guozhangwang @enothereska

@@ -389,6 +395,10 @@ private void shutdown() {
log.error("{} Failed to close restore consumer: ", logPrefix, e);
}

// hotfix to improve ZK behavior als long as KAFKA-4060 is not fixed (c.f. KAFKA-4369)
// when removing this, make StreamPartitionAssignor#internalTopicManager "private" again
partitionAssignor.internalTopicManager.zkClient.close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this buy us? Not clear from comment.

Copy link
Member Author

@mjsax mjsax Dec 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really related to this PR. But as reported in https://issues.apache.org/jira/browse/KAFKA-4369 right now we get a lot of this messages in the log:

[2016-07-14 09:49:21,790] WARN [main-SendThread(127.0.0.1:61385)] Session 0x155e860e62b0007 for server null, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
java.net.ConnectException: Connection refused
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
	at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1022)

As we want to remove ZK dependency, nobody picked up this bug and it's super annoying if you run test locally in a loop. We get rid of those log messages with this fix. It's not a completely nice fix (but only temporary so it should be ok) but it does the trick -- and I am not sure how long it will take to remove ZK dependency. Thus I though it might be worth to include it for now. Will get removed when ZK dependency gets removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking I'd suggest not having a single PR involved with multiple fixes, since it will make reviewing much harder. But since KAFKA-4369 will not be fixed this may be OK. Could you add a TODO at the beginning to make it more visible?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking I'd suggest not having a single PR involved with multiple fixes, since it will make reviewing much harder. But since KAFKA-4369 will not be fixed this may be OK. Could you add a TODO at the beginning to make it more visible?

@guozhangwang
Copy link
Contributor

LGTM overall, just one minor comment.

@asfbot
Copy link

asfbot commented Dec 10, 2016

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/58/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link

asfbot commented Dec 10, 2016

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/57/
Test PASSed (JDK 7 and Scala 2.10).

@asfbot
Copy link

asfbot commented Dec 10, 2016

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/59/
Test FAILed (JDK 8 and Scala 2.11).

@mjsax
Copy link
Member Author

mjsax commented Dec 10, 2016

@guozhangwang Updated.

@asfbot
Copy link

asfbot commented Dec 10, 2016

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/64/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link

asfbot commented Dec 10, 2016

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/66/
Test FAILed (JDK 8 and Scala 2.11).

@asfbot
Copy link

asfbot commented Dec 10, 2016

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/65/
Test FAILed (JDK 8 and Scala 2.12).

@guozhangwang
Copy link
Contributor

Merged to trunk.

@asfgit asfgit closed this in 6f7ed15 Dec 11, 2016
@mjsax mjsax deleted the kafka-4510-finish-rebalance-on-shutdown branch December 11, 2016 22:40
soenkeliebau pushed a commit to soenkeliebau/kafka that referenced this pull request Feb 7, 2017
Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Eno Thereska, Guozhang Wang

Closes apache#2227 from mjsax/kafka-4510-finish-rebalance-on-shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants