ruby-amqp/amqp — pull request #180 by JeetKunDoug (2013-11-26 19:59:33+00:00)
Title: Make sure channel doesn't attempt to send a close message before it's op...

...ened.

We ran into this issue when using EventMachine as a TCP/IP server and creating an AMQP channel to send messages back to our back-end. If our load balancer hits the TCP/IP side with a heartbeat check, we get a connect/disconnect fast enough that the channel attempts to send the close frame before the open has completed - something like:

Handling a connection-level exception.
conn.id : 70236508687680
conn.open : false
AMQP class id : 50,
AMQP method id: 10,
Status code : 504
Error message : CHANNEL_ERROR - expected 'channel.open'
state : #