Skip to content

Avoid KeyError: -1 when deleted topics linger #143

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

Closed

Conversation

stephenarmstrong
Copy link
Collaborator

I have hit this error in Kafka 0.8.1 a few times where after deleting a topic it still reports somehow into the client, and I end up with:

File "env/src/kafka-python/kafka/client.py", line 39, in __init__
    self.load_metadata_for_topics()  # bootstrap with all metadata
File "env/src/kafka-python/kafka/client.py", line 258, in load_metadata_for_topics
    self.topics_to_brokers[topic_part] = brokers[meta.leader]
KeyError: -1

I have hit this error in Kafka 0.8.1 a few times where after deleting a topic it still reports somehow into the client, and I end up with:

    File "env/src/kafka-python/kafka/client.py", line 39, in __init__
        self.load_metadata_for_topics()  # bootstrap with all metadata
    File "env/src/kafka-python/kafka/client.py", line 258, in load_metadata_for_topics
        self.topics_to_brokers[topic_part] = brokers[meta.leader]
    KeyError: -1
@mrtheb
Copy link
Collaborator

mrtheb commented Mar 17, 2014

can you check out #109 to see if it fits your requirements? it's been standing there for a while now.

@dpkp
Copy link
Owner

dpkp commented Mar 22, 2014

merged #109 which addresses this issue thoroughly. closing this issue as dup.

@dpkp dpkp closed this Mar 22, 2014
@stephenarmstrong stephenarmstrong deleted the deleted-topics branch May 21, 2014 18:25
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.

3 participants