如何修复在 akka scala 中生成持久性 actor 时的断路器超时异常?

How to fix a circuit breaker timed out exception on spawning a persistent actor in akka scala?

有没有人在持久化系统的 akka 上遇到断路器超时。 我相信当 akka 无法重新加载保存的事件快照时会发生这种情况。我尝试通过调整 conf 并向其添加 snapshot-store-plugin-fallback.snapshot-is-optional = true 来绕过此重新加载。然而,这也无济于事。

我正在使用 jdbc-journaljdbc-snapshot-store 作为 snapshot-store.plugin

如有任何帮助,我们将不胜感激!

Supervisor StopSupervisor saw failure: Exception during recovery. Last known sequence number [0]. PersistenceId [UCPersistenceId], due to: Exception during recovery. Last known sequence number [0]. PersistenceId [UCPersistenceId], due to: Circuit Breaker Timed out.","context":"default","exception":"akka.persistence.typed.internal.JournalFailureException: Exception during recovery. Last known sequence number [0]. PersistenceId [UCPersistenceId], due to: Exception during recovery. Last known sequence number [0]. PersistenceId [UCPersistenceId], due to: Circuit Breaker Timed out.

我在异常块后也收到此警告。

{"logger":"org.mariadb.jdbc.HostAddress","message":"Aurora recommended connection URL must only use cluster end-point like \"jdbc:mariadb:aurora://xx.cluster-yy.zz.rds.amazonaws.com\". Using end-point permit auto-discovery of new replicas","context":"default"}

断路器超时并不是真正的异常。它更像是另一个异常的症状,即源异常。我建议查看数据库服务器日志以了解实际发生的异常。

正如@Debasish-Ghosh(我强烈推荐其关于功能和反应域建模的书)指出的那样,断路器异常只是另一个故障的症状。

从警告来看,您似乎已将日志 and/or 快照配置为指向特定的 Aurora 副本而不是集群端点。如果该特定副本不可用,则与它的连接将失败并最终使断路器跳闸;这样做的效果是使读取或写入日志的尝试快速失败(以免消耗过多的资源,并在失败是由于过载造成的情况下让数据库有机会恢复)。

因此,对于这个特定问题,我建议在您的配置中使用 Aurora 集群端点,这应该不会导致副本不可用。