Skip to content

fix(reminders): gate delivery on active silo#10154

Merged
ReubenBond merged 4 commits into
dotnet:mainfrom
ReubenBond:reubenbond/active-silo-reminders
May 29, 2026
Merged

fix(reminders): gate delivery on active silo#10154
ReubenBond merged 4 commits into
dotnet:mainfrom
ReubenBond:reubenbond/active-silo-reminders

Conversation

@ReubenBond

@ReubenBond ReubenBond commented May 29, 2026

Copy link
Copy Markdown
Member

This updates LocalReminderService so reminder metadata can still be loaded and updated before the silo is active, while actual tick delivery only begins once the silo reaches Active and stops before shutdown continues.

It also makes existing local reminders start when delivery is enabled, avoiding the race where reminders loaded before Active never fired, and updates the related reminder test grain to recover reminder metadata after failover.

@ReubenBond ReubenBond requested a review from Copilot May 29, 2026 21:27
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Gates reminder tick delivery on the silo reaching Active, while still allowing reminder metadata to be loaded/updated earlier. LocalReminderService now has explicit start/stop-delivery hooks tied to ServiceLifecycleStage.Active, and LocalReminderData.Start() becomes idempotent TryStart() so delivery can begin lazily for reminders that were loaded before the silo was active. ReminderTestGrain2 (and its copy) recover reminder metadata via GetMissingReminders() after failover.

Changes:

  • Introduce _isDeliveringReminders/_activeReminderDeliveries/_deliveryQuiesced machinery and gate RunAsync ticks via TryBeginSingleReminderDelivery/CompleteSingleReminderDelivery.
  • Subscribe StopDeliveringReminders at ServiceLifecycleStage.Active, restructure Stop() onto the system target scheduler with CheckRuntimeContext() calls scattered across reminder methods.
  • Make LocalReminderData.Start idempotent (TryStart) and start existing reminders when delivery is enabled; teach ReminderTestGrain2 ticks to lazily reload metadata.
Show a summary per file
File Description
src/Orleans.Reminders/ReminderService/LocalReminderService.cs Splits metadata management from tick delivery; adds delivery gating, quiescence, lifecycle stop hook, and runtime-context checks.
test/Grains/TestInternalGrains/ReminderTestGrain2.cs Reloads reminder metadata on tick when the activation hasn’t seen the reminder before, supporting failover scenarios.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

ReubenBond and others added 2 commits May 29, 2026 15:07
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ReubenBond ReubenBond enabled auto-merge May 29, 2026 22:09
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants