Hi,
first of all, I'd like to make it clear that I'm pretty much new to both golang and kafka :-)
I've been spending a bit of time testing sarama and I found that a producer (I didn't try consumer yet) will hang for ever if the kafka server host name cannot be resolve.
After some digging, I was able to enable the driver's logging from my producer and this is the output:
[Sarama] 2014/07/02 00:02:06 Initializing new client
[Sarama] 2014/07/02 00:02:06 Fetching metadata from broker
10.0.3.213:9092[Sarama] 2014/07/02 00:02:06 Connected to broker
10.0.3.213:9092[Sarama] 2014/07/02 00:02:06 Registered new broker #0 at kafka01:9092
[Sarama] 2014/07/02 00:02:06 Successfully initialized new client
[Sarama] 2014/07/02 00:02:06 Failed to connect to broker kafka01:9092
[Sarama] 2014/07/02 00:02:06 dial tcp: lookup kafka01: no such host
And here it hangs, nothing else is happening. I'm using IP address for connecting to the kafka server but somehow, the producer gets the hostname from kafka and then retries the connection against that hostname. I'm guessing this is how kafka works because I found the Ruby driver does the same but instead it raises an exception produced by the Socket call, I might be wrong, haven't checked kafka documentation deeply enough.
Anyway, what I was wondering is if this is the expected behavior because IMHO I'd expect it to panic...I don't really see the point for it hanging there.
Thanks!