diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/SqlJournal.cs b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/SqlJournal.cs index bd439ef2aec..967dda87731 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/SqlJournal.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/SqlJournal.cs @@ -257,8 +257,9 @@ protected bool WaitingForInitialization(object message) return true; case Status.Failure fail: Log.Error(fail.Cause, "Failure during {0} initialization.", Self); - Context.Stop(Self); - return true; + + // trigger a restart so we have some hope of succeeding in the future even if initialization failed + throw new ApplicationException("Failed to initialize SQL Journal.", fail.Cause); default: Stash.Stash(); return true; diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Snapshot/SqlSnapshotStore.cs b/src/contrib/persistence/Akka.Persistence.Sql.Common/Snapshot/SqlSnapshotStore.cs index c2faf4f038e..8b3b86dcf95 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Snapshot/SqlSnapshotStore.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Snapshot/SqlSnapshotStore.cs @@ -137,8 +137,9 @@ private bool WaitingForInitialization(object message) return true; case Status.Failure msg: Log.Error(msg.Cause, "Error during snapshot store initialization"); - Context.Stop(Self); - return true; + + // trigger a restart so we have some hope of succeeding in the future even if initialization failed + throw new ApplicationException("Failed to initialize SQL SnapshotStore.", msg.Cause); default: Stash.Stash(); return true;