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-4708: Fix Transient Failure in BrokerApiVersionsCommandTest.che… #2489

Closed
wants to merge 2 commits into from

Conversation

cmccabe
Copy link
Contributor

@cmccabe cmccabe commented Feb 3, 2017

…ckBrokerApiVersionCommandOutput

@asfbot
Copy link

asfbot commented Feb 3, 2017

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

@asfbot
Copy link

asfbot commented Feb 3, 2017

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

@asfbot
Copy link

asfbot commented Feb 3, 2017

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

Copy link

@hachikuji hachikuji left a comment

Choose a reason for hiding this comment

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

Thanks for the patch. Left a couple minor comments.

@@ -39,7 +40,17 @@ object BrokerApiVersionsCommand {
def execute(args: Array[String], out: PrintStream): Unit = {
val opts = new BrokerVersionCommandOptions(args)
val adminClient = createAdminClient(opts)
val brokerMap = adminClient.listAllBrokerVersionInfo()

// Wait until AdminClient#findAllBrokers returns a non-empty list of brokers
Copy link

@hachikuji hachikuji Feb 6, 2017

Choose a reason for hiding this comment

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

Maybe we could move this to a separate method in AdminClient? Something like awaitBrokers?

Copy link
Member

Choose a reason for hiding this comment

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

Just my 2 cents. I actually think this logic is waiting is better here unless we have more use-case for this awaitBrokers(). The idea is to focus AdminClient on the admin operation.

I am wondering if the code below may be slightly better:

var brokerMap = Map.empty[Node, Try[NodeApiVersions]]

do {
  Thread.sleep(50)
  brokerMap = adminClient.listAllBrokerVersionInfo()
} while (brokerMap.isEmpty)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lindong28 : Good idea. I think using a do...while loop is better.

@hachikuji: Yeah, let's have a method in AdminClient to do this... it seems simple enough.

while (nodes.isEmpty) {
nodes = adminClient.findAllBrokers()
if (nodes.isEmpty)
Thread.sleep(1)

Choose a reason for hiding this comment

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

Seems a bit low. Perhaps 50ms would be more reasonable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@asfbot
Copy link

asfbot commented Feb 17, 2017

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

@asfbot
Copy link

asfbot commented Feb 17, 2017

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

@asfbot
Copy link

asfbot commented Feb 17, 2017

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

@asfgit asfgit closed this in 913c09e Feb 22, 2017
@ijuma
Copy link
Contributor

ijuma commented Feb 22, 2017

Thanks for the PR, LGTM, merging to trunk. A couple of notes:

  1. There was a failure recently: https://jenkins.confluent.io/job/kafka-0.10.2/92/testReport/junit/kafka.admin/BrokerApiVersionsCommandTest/checkBrokerApiVersionCommandOutput/

  2. It would be good for awaitBrokers to have a timeout, but since it's internal and soon to be replaced by AdminClient.java, this seems OK for now.

hachikuji pushed a commit to confluentinc/kafka that referenced this pull request Feb 23, 2017
…ckBrokerApiVersionCommandOutput

Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Jason Gustafson <jason@confluent.io>, Dong Lin <lindong28@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes apache#2489 from cmccabe/KAFKA-4708
@cmccabe cmccabe deleted the KAFKA-4708 branch May 20, 2019 18:35
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.

5 participants