[rabbitmq-discuss] Broken Pipe in RabbitMQ ConnectionFactory.newConnection()

Matthias Radestock matthias at rabbitmq.com
Mon Sep 9 04:07:18 BST 2013


On 08/09/13 23:04, Michael Klishin wrote:
> I can imagine there are potential issues in connection shutdown code
> in some clients

But there shouldn't be. If so, there's a bug that I'd rather see fixed. 
I don't think there is though...

The OP's problem has all the hallmarks of the client, server, or network 
being overloaded. The "{handshake_timeout,frame_header}" in the logs 
indicates that the connection establishment handshake took longer than 
10 seconds. The reported connection.close hang is another indication. To 
the OP: it should not hang indefinitely; it would be good to find out 
how long it takes to return and what 'rabbitmqctl list_connections' says 
at the time.

> Consider using a long-lived connection

That's good advise. I also recommend re-using the temporary reply 
queues; creating one queue per rpc is really inefficient. And finally, 
get rid of the semi-busy loop in the consuming code. What's the point of 
calling nextDelivery with a 100ms timeout, when the code simply loops 
around on timeout?!

Oh, and another thing...

The code is setting an expiry on the published message. If that ever 
gets triggered, then no reply will be sent and the code becomes stuck 
going round the aforementioned consumer loop forever.

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list