segmentio / kafka-go

Kafka library in Go
MIT License
7.5k stars 776 forks source link

DialLeader infinity loop on unknown topic or partiotion #531

Open 100mll opened 3 years ago

100mll commented 3 years ago

https://github.com/segmentio/kafka-go/blob/76ece4c958e28d0a432ed90cb7a19cc7d37a0eef/dialer.go#L188

if use DialLdeader with background context, it will start infinity loop in LookupPartition case attempts loop can't return UnknownTopicOrPartition error.

aultimus commented 3 years ago

Hi @100mll I believe that this happens if you have are trying to connect to a topic that does not exist with auto create topics disabled (KAFKA_AUTO_CREATE_TOPICS_ENABLE='false'). Can you please set the config setting KAFKA_AUTO_CREATE_TOPICS_ENABLE='true' and see if the issue persists?