Search code examples
azureactorazure-service-fabricreminders

Azure Service Fabric actor reminder update?


Suppose I have a reliable actor that registers a reminder in OnActivateAsync. This reminder has a period that is retrieved from some persistent storage. After some time the actor is garbage-collected.

After some more time the actor is called or the reminder fires and OnActivateAsync is called by the runtime. In the meantime, I updated the reminder period in persistent storage.

What happens now? I attempt to register the reminder again but with a different period. Will the reminder be updated with the new period?

Another case is an update of the actor. Suppose the period is hard-coded but a new version of the actor uses a different period. What happens now when OnActivateAsync is called and the reminder is registered again?


Solution

  • When you try to register an existing reminder again, it will be updated. From RegisterReminderAsync documentation (https://learn.microsoft.com/en-us/dotnet/api/microsoft.servicefabric.actors.runtime.actorbase.registerreminderasync?view=azure-dotnet):

    Existing reminders can also be updated by calling this method again.