From 0141b6ab9a94297fc73b5770afd2d068634b6757 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 25 Nov 2024 15:12:41 -0600 Subject: [PATCH] Add note about duplicate `PeriodicTimer` messages when actors are busy (#7396) --- src/core/Akka/Actor/Scheduler/TimerScheduler.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/Akka/Actor/Scheduler/TimerScheduler.cs b/src/core/Akka/Actor/Scheduler/TimerScheduler.cs index 9f87efdc371..c73994cd5fe 100644 --- a/src/core/Akka/Actor/Scheduler/TimerScheduler.cs +++ b/src/core/Akka/Actor/Scheduler/TimerScheduler.cs @@ -293,6 +293,9 @@ public object InterceptTimerMsg(ILoggingAdapter log, ITimerMsg timerMsg) return null; // message should be ignored } + // N.B. - repeating timers never change their generation, so this check always passes. + // This means that, in theory, a repeating timer can queue up the same message many times + // in the actor's mailbox (i.e. when actor is busy) and there's no means of de-duplicating it. if (timerMsg.Generation == timer.Generation) { // valid timer