You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is causing issues but looking at the code it might be needed that these code paths all need to have exception handling to prevent code not to terminate if these ObjectDisposedExceptions are to be expected.
Reproduction steps
Use MassTransit.RabbitMQ 8.3.4
Log FirstChanceException
Create a consumer and connect to the broker
Close the connections on the broker
Observe the consumer trying to reconnect
Do this a couple of times and you'll see the related exception
Expected behavior
gracefully handle ObjectDisposedException on all code paths for closed connections
Describe the bug
Logging FirstChanceExceptions shows some strange ObjectDisposedException:
https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/v7.0.0/projects/RabbitMQ.Client/Impl/Connection.Heartbeat.cs#L164 accessing
.Token
here can result in an ObjectDisposedException. That is catched, but the comment states that its for the timerThe SetSessionClosingAsync uses a
_closingSemaphore
that can already be disposed. It seems this isn't gracefully handled in the stacktrace.https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/v7.0.0/projects/RabbitMQ.Client/Impl/MainSession.cs
I'm not sure if this is causing issues but looking at the code it might be needed that these code paths all need to have exception handling to prevent code not to terminate if these ObjectDisposedExceptions are to be expected.
Reproduction steps
Do this a couple of times and you'll see the related exception
Expected behavior
gracefully handle ObjectDisposedException on all code paths for closed connections
Additional context
Originally reported by @ramonsmits here: #1749
The text was updated successfully, but these errors were encountered: