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

KeyedProducer doesn't recover from a kafka node going down #313

Closed
carlosperello opened this issue Feb 6, 2015 · 3 comments
Closed

KeyedProducer doesn't recover from a kafka node going down #313

carlosperello opened this issue Feb 6, 2015 · 3 comments

Comments

@carlosperello
Copy link

Hi,

We are using kafka-python 0.9.3 with Kafka 0.8.2 on a cluster of three nodes. We found that if we turn down one of the kafka nodes, our producers fail to send messages to kafka until we restart them. It seems to be that kafka-python doesn't detect partition leader changes. Is that expected? may it be something we do wrong while using your library?

Thanks.

@carlosperello
Copy link
Author

This is the error we get on the producer:

Traceback (most recent call last):
File "/var/www/honshuu-alerts-processing/src/serverdensity/alerts_processing/tornado/app.py", line 102, in post
json.dumps(payload))\n File "/var/www/honshuu-alerts-processing/eggs/kafka_python-0.9.3-py2.7.egg/kafka/producer/keyed.py", line 60, in send_messages
partition = self._next_partition(topic, key)\n File "/var/www/honshuu-alerts-processing/eggs/kafka_python-0.9.3-py2.7.egg/kafka/producer/keyed.py", line 57, in _next_partition
return partitioner.partition(key, self.client.get_partition_ids_for_topic(topic))
File "/var/www/honshuu-alerts-processing/eggs/kafka_python-0.9.3-py2.7.egg/kafka/partitioner/hashed.py", line 9, in partition
size = len(partitions)
TypeError: object of type 'NoneType' has no len()

@dpkp
Copy link
Owner

dpkp commented Feb 6, 2015

thanks for the bug report -- i wrote a quick test to verify and will see if I can fixup quickly.

@dpkp dpkp changed the title Producer doesn't recover from a kafka node going down KeyedProducer doesn't recover from a kafka node going down Feb 6, 2015
@carlosperello
Copy link
Author

I just tested your patch and it solved the issue I had. Thanks!

@dpkp dpkp closed this as completed Mar 30, 2015
@dpkp dpkp added this to the 0.9.4 Release milestone Mar 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants