ruby-amqp/bunny — pull request #254 by foeken (2014-10-14 12:53:10+00:00)
Title: Added read timeout to socket

After some production runs the code seems to hold up properly. To create a full-proof consumer you will need to set the `recover_from_connection_close` options. If one node is removed (graceful shutdown for maintenance) the connections are closed. Without this setting the consumer will not reconnect.

Perhaps it should default to true?

One issue we encountered was that in some cases the socket would block while reconnecting. I have not been able to find a specific reason to explain why this is happening but the result is a consumer that 'hangs'.

The code below adds the `@read_write_timeout` behaviour to reading too, previously it was just applied to writing to the socket. This will ensure that even in these cases the reconnect mechanism will kick-in.

We found no other issues in production.