CatchUpError + System.ObjectDisposedException: Cannot access a disposed object

Hi

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)
{
Thread.Sleep(100);

“Creating subscription”.Dump();

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

var connectionString = “GossipSeeds=127.0.0.1:1113,127.0.0.1:2113,127.0.0.1:3113; HeartBeatTimeout=500;MaxReconnections=10000000;MaxRetries=10000000”;

var connection = EventStoreConnection.Create(connectionString);
connection.ConnectAsync().Wait(TimeSpan.FromSeconds(5));
CreateSubscription(connection);

Util.KeepRunning();

``

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?