[rabbitmq-discuss] Unexpected server crash and .NET API: disconnect is not detected?

Emile Joubert emile at rabbitmq.com
Wed Mar 30 16:36:53 BST 2011

Hi Alfonso,

On 30/03/11 15:43, Alfonso wrote:
> Hi,
> This is a difficult one: I've observed a couple of times that my
> consumer (.NET API 2.2.0) doesn't notice when the server that is
> running RabbitMQ (2.2.0) crashes.
> Please note that I mean server crash -unexpected shutdown, OS crash,
> etc.- not RabbitMQ crash.
> My application is consuming from a queue using "foreach" to get the
> messages and I has an event handler attached to the onShutdown event.

I'm not able to reproduce this using version 2.2.0 of the broker and the 
.NET client, implementing the the Subscription pattern. A connectivity 
problem immediately causes an OperationInterruptedException to be thrown 
from ConnectionBase.Dispose().

> Time ago disconnection tests consisting of disconnecting the consumer
> from the web admin console were made and the event handler was fired
> always. So disconnections are caught and logged properly.
> The problem is that the consumer got stuck when the server crashed and
> it didn't notice that the connection was gone (due to a server crash)
> so it was impossible to log a disconnection error.
> In the code there is a while loop for reconnecting when the connection
> fails but didn't loop because my guess is that the code were stuck in
> the "foreach".
> Am I missing something or this could be and issue?

Is it possible that you are preventing an exception from the socket from 
affecting the Subscription? Posting a minimal piece of code for 
demonstration may be useful.



More information about the rabbitmq-discuss mailing list