I’ve been struggling with this for a while now. I have a service that will run just fine while I’m testing it, but when left to run on a schedule, it will always end up throwing an ObjectDisposed exception in my service bus logs and I can’t quite figure why.
MesCannot access a disposed object.Object name: ‘Reviews-Service-Command’.
Reviews-Service-Command is the connectionName to the EventStore connection.
The EventStore connection is a DI’d as a singleton, and there is nowhere in the code where it is ever explicitly told to close or dispose, so the only think I can think of is that it is closing and disposing itself. I added logging for Connected, Disconnected, Reconnecting, Closed, and ErrorOcurred events but the only log that I can find is from the Closed event. The reason states that it is because the max reconnect limit has been exceeded, but I can’t find any other logs that even say it was being disconnected in the first place (not that it matters because that event doesn’t seem to offer a reason).
So I’m looking for some threads to pull on
Other Info:
-
Hosted on Azure on a Linux VM
-
Heartbeat Timeout set to 1000ms
-
Verbose logging is currently not on because this service is relatively high volume and would fill up my log files too quick to find anything useful. I would expect failing conditions that result in a disconnect to be output on the Error channel – I’m going to see if I can’t
-
In the meanwhile, I’m going to attempt capture a verbose log, but the last time I did this, I only found heartbeat timeouts which seem to happen pretty often even when ever thing is working … very confusing.