pykafka icon indicating copy to clipboard operation
pykafka copied to clipboard

Possible to have more descriptive errors when deleting topics

Open rueberger opened this issue 6 years ago • 1 comments

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.

rueberger avatar Aug 08 '18 21:08 rueberger

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.

emmettbutler avatar Aug 09 '18 18:08 emmettbutler