=per #15943 Avoid initite restart loop when recovery fails
* also include the failing message and sequenceNr in the RecoveryFailure message * remove the "putting back" the message first in the mailbox
This commit is contained in:
parent
da7991a3d5
commit
72d54626f3
6 changed files with 123 additions and 75 deletions
|
|
@ -23,9 +23,24 @@ case class PersistenceFailure(payload: Any, sequenceNr: Long, cause: Throwable)
|
|||
/**
|
||||
* Sent to a [[PersistentActor]] if a journal fails to replay messages or fetch that persistent actor's
|
||||
* highest sequence number. If not handled, the actor will be stopped.
|
||||
*
|
||||
* Contains the [[#sequenceNr]] of the message that could not be replayed, if it
|
||||
* failed at a specific message.
|
||||
*
|
||||
* Contains the [[#payload]] of the message that could not be replayed, if it
|
||||
* failed at a specific message.
|
||||
*/
|
||||
@SerialVersionUID(1L)
|
||||
case class RecoveryFailure(cause: Throwable)
|
||||
case class RecoveryFailure(cause: Throwable)(failingMessage: Option[(Long, Any)]) {
|
||||
override def toString: String = failingMessage match {
|
||||
case Some((sequenceNr, payload)) ⇒ s"RecoveryFailure(${cause.getMessage},$sequenceNr,$payload)"
|
||||
case None ⇒ s"RecoveryFailure(${cause.getMessage})"
|
||||
}
|
||||
|
||||
def sequenceNr: Option[Long] = failingMessage.map { case (snr, _) ⇒ snr }
|
||||
|
||||
def payload: Option[Any] = failingMessage.map { case (_, payload) ⇒ payload }
|
||||
}
|
||||
|
||||
abstract class RecoveryCompleted
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue