GitHub user noslowerdna opened a pull request:
https://github.com/apache/kafka/pull/2425
KAFKA-4687: Fix InvalidTopicException due to topic creation race condition
Pull request for https://issues.apache.org/jira/browse/KAFKA-4687, complete
details can be found in the Jira.
With this change, instead of incorrectly throwing an InvalidTopicException,
a TopicExistsException would be thrown
[here](https://github.com/apache/kafka/blob/0.10.1.1/core/src/main/scala/kafka/admin/AdminUtils.scala#L474).
Note that an alternative (or possibly additional) change could be to
proactively check if the retrieved topic inventory
[here](https://github.com/apache/kafka/blob/0.10.1.1/core/src/main/scala/kafka/admin/AdminUtils.scala#L432)
contains the topic being created, and throw a TopicExistsException at that
point. Let me know if that would be preferred, and I'll update the code
accordingly.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/noslowerdna/kafka KAFKA-4687
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/2425.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 #2425
----
commit 8d5ab380868d2be72992701174edf9ab26928ca5
Author: Andrew Olson <[email protected]>
Date: 2017-01-23T22:40:06Z
KAFKA-4687: Fix InvalidTopicException due to topic creation race condition
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---