bpot / poseidon

A client for Kafka 0.8
MIT License
260 stars 101 forks source link

Poseidon::Connection#read_response hides Timeout errors #92

Open ntl-bypass opened 9 years ago

ntl-bypass commented 9 years ago

I want to be able to read from Kafka indefinitely in an infinite loop. When developing locally on my laptop, I often have no messages to read. I'd like to just block the process calling #fetch by rescuing timeouts and rerunning #fetch. However, the exception class ConnectionFailedError is raised in place of not only TimeoutException, but also Errno::ECONNRESET and SocketError.

The consequence for me is that my spin loop can't distinguish between network errors and a partition that simply has no messages to send down to the client. Is there another way I should be doing this, e.g. detecting if I have no messages before I call fetch?

mensfeld commented 9 years ago

+1

alexcastano commented 8 years ago

+1