akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.72k stars 1.04k forks source link

Akka.Persistence - fail loudly when the backend store connection cannot be established #2320

Open eriklagerholm opened 8 years ago

eriklagerholm commented 8 years ago

In its current state, it seems like the persistence framework doesn't bubble exceptions when opening connections to the backend store. This was encountered using the SqlServer adapter and when providing a bad connection string the exception generated when opening the sql connection is not caught by the actor system logger. This silent error results in persistent actors getting stuck in recovery mode, thus giving the impression of the system just stopping without any apparent reason.

By checking out the SqlServer adapter repo and debugging the code I was able to see that my bad connection string did indeed generate an exception when the adapter tried to open an sql connection, but somewhere the exception seems to be handled without any logging behaviour. As a user I would expect a fatal log entry, clearly stating what wrong.

This might be unique to the sql framework or the sqlserver adapter specifically. I have not had the ability to test this using other adapters.

I've attached some screenshots to more specifically describe the flow of events.

The occurring exception while debugging the sql adapter:

exception being thrown

The current config with broken connection string and the logging behaviour with the coordinator actor seemingly stuck in recovery

logging from the actor system

malclear commented 4 years ago

This has been open for a while. Are there any plans to address this?

malclear commented 4 years ago

On further review, it seems that this has been addressed. Can the issue be closed?