Once an AutoRecoveringConnection connection enters auto recovery and trying to recover the connection will continue to do try forever even if the connection is manually closed.
I am not super familiar with the code, but believe the issue lays in the RecoverConnectionDelegate method that enters a while loop and fails to check if the connection has been manually closed via the manuallyClosed variable.
The order for a repro is:
- Create and Open auto recovering connection
- Sever the network connection between the client and rabbit server. The connection will start attempting auto-recovery.
- Call .Close() and/or .Dispose() on the connection
- Observe that the connection continues to try and auto-recover ... forever.
I would have expected that the connection would have given up trying to reconnect after it was closed, but i might be missing some subtle issue here that i am not aware of.