Recovering from connection errors

I’m about to add the finishing touches to an application that goes live in January. The problem I have is recovering from (and detecting) connection errors in the .net client. Before I start investegating further I thought I’d ask if there are any changes to this behaviour in the upcoming version? (I recall there was a thread about it in this group a while ago).

/Peter

Hi,

It depends what kind of errors. The default policy for client side errors when using the event store should be to retry. This is also true for the .NET API. You can set the number of retries by using SetMaxRetriesTo or KeepRetrying on the connection settings
builder.

For disconnections the mechanism on trunk is different to the current binaries on Nuget, using .NET events on disconnected, reconnected etc. Durable subscriptions then hook into these to resume on reconnection as can any custom code you need to run. You
can set the number of retries using LimitReconnectionsTo or KeepReconnecting (the names are similar to that, may not be exact)

James

I’ve had cases where disconnect hasn’t fired, and all subsequent calls have hanged. But I’ll have a more methodical look, just wanted to make sure there wasn’t gonna be a change in behaviour soon anyway,

Can you post the connection settings setup you’re using (with any identifying details removed obviously!) - I’ve not come across that problem before

James

I think it was related to a database I screwed up during development (wrote silly amounts of events in one transaction before relasing what was happening). After that I couldn’t connect properly. The db is gone now, so I’m not sure I’ll be able to reproduce, but I’ll have a proper look tomorrow.

/Peter

Interesting, that shouldn’t happen either way. Will investigate.

Thanks,

James

Haven’t been able to reproduce the issue with missing Disconnect-events, but I think the hanging issue was due to trying to reuse a failed connection, rather than creating a new one. Don’t know it it’s intentional, but I couldn’t get an existing Connection to connect again once Disconnect had been fired.

/Peter