Merge pull request #28542 from fredfp/issue-28541
Shield unsafe journal plugins from corner case, #28541
This commit is contained in:
commit
ec3d67df7e
1 changed files with 5 additions and 0 deletions
|
|
@ -69,6 +69,11 @@ trait AsyncWriteJournal extends Actor with WriteJournalBase with AsyncRecovery {
|
|||
val atomicWriteCount = messages.count(_.isInstanceOf[AtomicWrite])
|
||||
val prepared = Try(preparePersistentBatch(messages))
|
||||
val writeResult = (prepared match {
|
||||
case Success(prep) if prep.isEmpty =>
|
||||
// prep is empty when all messages are instances of NonPersistentRepr (used for defer) in that case,
|
||||
// we continue right away without calling the journal plugin (most plugins fail calling head on empty Seq).
|
||||
// Ordering of the replies is handled by Resequencer
|
||||
Future.successful(Nil)
|
||||
case Success(prep) =>
|
||||
// try in case the asyncWriteMessages throws
|
||||
try breaker.withCircuitBreaker(asyncWriteMessages(prep))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue