dotnet / orleans

Cloud Native application framework for .NET
https://docs.microsoft.com/dotnet/orleans
MIT License
9.89k stars 2.01k forks source link

Ensure reminder table is initialized before access #8982

Closed ReubenBond closed 3 weeks ago

ReubenBond commented 3 weeks ago

It is possible that the IReminderTable implementation might be accessed before it has been successfully initialized. This PR ensures that is not the case for LocalReminderService by initializing the table before starting the LocalReminderService and before grains are allowed to start.

While doing so, I also implemented support for CancellationToken in IReminderTable for startup/shutdown, obsoleting the existing Init() method and replacing it with StartAsync(CancellationToken), adding a new StopAsync(CancellationToken).

Microsoft Reviewers: Open in CodeFlow