Search code examples
c#actorazure-service-fabricinteger-overflow

How to make a ServiceFabric actor go off in the far future


So if I have an actor and I use the following line:

await RegisterReminderAsync("My Reminder", new byte[0], 
    TimeSpan.FromDays(30), TimeSpan.FromSeconds(60)).ConfigureAwait(false);

I can set a reminder to go off in 30 days, with a period of 60 seconds. However, if I try to setup a reminder to go off in 60 days, an exception will be thrown because RegisterReminderAsync converts the due data to milliseconds as an unsigned integer (uint), which can only hold around 50 days. So, what if I want to set a reminder for a year in the future? Or 10 years?

I could set the reminder to populate a new reminder when the old reminder is called, thereby allowing me to extend the period indefinitely but that seems dirty and not the best implementation we could use. Is there a way to specify how the method should handle the due date?


Solution

  • Yup, that's how it works today but I opened an issue to use int64 instead: https://github.com/Azure/service-fabric-services-and-actors-dotnet/issues/13