[ 
https://issues.apache.org/jira/browse/KAFKA-3217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15136702#comment-15136702
 ] 

ASF GitHub Bot commented on KAFKA-3217:
---------------------------------------

GitHub user rajinisivaram opened a pull request:

    https://github.com/apache/kafka/pull/882

    KAFKA-3217: Close producers in unit tests

    Producers that are not closed auto-create topics in subsequent tests when 
Kafka server port is reused. Added missing close().

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rajinisivaram/kafka KAFKA-3217

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/882.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 #882
    
----
commit 30e7ed8e4d228aff9b5dd26ba523ece7cbb565dc
Author: Rajini Sivaram <rajinisiva...@googlemail.com>
Date:   2016-02-08T08:30:03Z

    KAFKA-3217: Close producers in unit tests

----


> Unit tests which dont close producers auto-create topics in Kafka brokers of 
> other tests when port is reused
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-3217
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3217
>             Project: Kafka
>          Issue Type: Bug
>          Components: unit tests
>    Affects Versions: 0.9.0.0
>            Reporter: Rajini Sivaram
>            Assignee: Rajini Sivaram
>
> Consumer tests occasionally fail the exception:
> {quote}
> kafka.common.TopicExistsException: Topic "topic" already exists.
>         at 
> kafka.admin.AdminUtils$.createOrUpdateTopicPartitionAssignmentPathInZK(AdminUtils.scala:261)
>         at kafka.admin.AdminUtils$.createTopic(AdminUtils.scala:245)
>         at kafka.utils.TestUtils$.createTopic(TestUtils.scala:237)
>         at kafka.api.BaseConsumerTest.setUp(BaseConsumerTest.scala:65)
> {quote}
> Recreated this failure with some additional logging and it turns out that the 
> failure is because a few tests which create a topic named "topic" close their 
> Kafka server, but not the producer. When the ephemeral port used by the 
> closed Kafka server gets reused in another Kafka server in a subsequent test, 
> the producer retries of the previous test cause "topic" to be recreated using 
> auto-create in the new Kafka server of the subsequent test.  This results in 
> an error in the consumer tests occasionally when the topic is auto-created 
> before the test attempts to create it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to