CatchUpError + System.ObjectDisposedException: Cannot access a disposed object


In our catch up subscriptions we are getting a CatchUpError + “System.ObjectDisposedException: Cannot access a disposed object” from the connection when we try to resubscribe.

We don’t call Dispose() on the connection object from our code…

The scenario is: EventStore is running when the program starts, if we then shut it down after some time the above exception surfaces. The connection is configured with KeepReconnecting().

Any hints?

Can you provide a reproduction?

This will do the trick. The client library is 3.9.4 and server is 3.9.3.

void CreateSubscription(IEventStoreConnection c)

“Creating subscription”.Dump();

c.SubscribeToStreamFrom(“footest”, 0, true, (sub, evt) => evt.Dump(), subscriptionDropped: (sub, reason, e) =>
$“Subscription faulted: {e}”.Dump();

var connectionString = “GossipSeeds=,,; HeartBeatTimeout=500;MaxReconnections=10000000;MaxRetries=10000000”;

var connection = EventStoreConnection.Create(connectionString);



It’s a linqpad script, so replace Dump() with Console.WriteLine…

Event store is running when I start the script and a few events are in “footest”.

When I stop the event store after a while I get:

Subscription faulted: System.ObjectDisposedException: Cannot access a disposed object.
Object name: ‘ES-add1527b-6840-4311-a5e1-e129789a3c19’.


Thanks! will look into it

Any news on this?

Any updates on this bug?