Closed mgw854 closed 6 years ago
Correct me if I am mistaken, there is zero memory available for the server to work with and Connection.Dispose throws an exception?
If thats the case, the server needs to have some memory to receive the events from client.
RabbitMQ and Erlgang purposely run on a system where it will use every available resource if you let. Such systems do not hold your hand like an operating system would assist in situations like this.
The remote RabbitMQ server believes that it has no memory available, yes (it's crossed the high water mark). We know that's an undesired scenario, but we hit it once accidentally and want to make sure that our applications can gracefully recover from this situation in the future in case it happens again.
Connection.Dispose doesn't throw an exception, it just hangs forever.
Test a regular RabbitMQ connection Dispose().
If it freezes still there isn't much RawRabbit can do no?
I'm running some tests on an application that uses RawRabbit to ship informational messages. Very infrequently, we run into the case where RabbitMQ is just so overwhelmed that it can't give us back a publisher confirmation for the message. In that scenario, we want to try again a few times, and then eventually drop the message (note, however, that if the message does make it into RabbitMQ, it should stay until it is popped off the queue).
To simulate this, I can run this command inside a Docker container running RabbitMQ:
RabbitMQ will not accept any messages coming in, even though you can connect to it. This works fine, and it behaves normally (well, throws PublishConfirmException) until I try to stop the application. I've traced this with a debug build of RawRabbit (latest), and see that it blocks indefinitely inside of ChannelFactory's Dispose method, specifically this line:
I can still see in the flat file logs events being emitted:
Our configuration: