pykafka
pykafka copied to clipboard
Possible to have more descriptive errors when deleting topics
Just encountered a scenario where I was trying to delete a topic like this:
cl = pykafka.KafkaClient(...)
test_topic = cl.topics['test'.encode()]
cl.cluster.controller_broker.delete_topics(['test'.encode()], timeout=1000)
and got a SocketDisconnectedError
. Eventually tracked the problem down to topic deletion being disabled in the server config. Not sure if it's feasible to have a more descriptive error here, but it would be useful sometimes.
I'll have to look into this. IIRC Kafka itself isn't super helpful on the request itself when topic deletion is disabled, so handling this error would probably have to involve reading the topic config. If that's the case, I think the best we can reasonably do is to mention that fact in an error message here.