kafka-go
kafka-go copied to clipboard
Reader block indefinitely during kafka deployment
Describe the bug
If a reader is started before any kafka deployment, whend kafka is finally deployed, the reader block and the ReadMessage function block.
Kafka Version
- What version(s) of Kafka are you testing against?
3.2 deployed using strimzi operator in a kubernetes environment.
- What version of kafka-go are you using?
Could reproduce it with 0.4.35 and 0.4.38
Expected Behavior
The ReadMessage should either return an error or the next message but not block indefinitely
Observed Behavior
In a loop constantly reading message from a kafka cluster. If the kafka cluster was not deployed and is deployed after the loop was started, the ReadMessage start to block. The blocking happen at the same time the kafka cluster was deployed. The readMessage was successfully returning an error when kafka was not deployed.
Additional Context
I can not provide debug logs because I could not reproduce the bug with a loglevel set to debug. It looks like some race condition and setting loglevel to debug prevent it to happens in some way.
Hi @OlivierCazade can you confirm how long you waited before determining that it was blocking indefinitely? Is it longer than the ReadTimeout
? Was kafka rebalancing?
Debug logs would be helpful, it would also be helpful to have a reliable way to reproduce the issue in order to fix it.