fix(reminders): gate delivery on active silo#10154
Merged
ReubenBond merged 4 commits intoMay 29, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
51ad35f to
25e190a
Compare
Contributor
There was a problem hiding this comment.
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/_deliveryQuiescedmachinery and gateRunAsyncticks viaTryBeginSingleReminderDelivery/CompleteSingleReminderDelivery. - Subscribe
StopDeliveringRemindersatServiceLifecycleStage.Active, restructureStop()onto the system target scheduler withCheckRuntimeContext()calls scattered across reminder methods. - Make
LocalReminderData.Startidempotent (TryStart) and start existing reminders when delivery is enabled; teachReminderTestGrain2ticks 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
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jun 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.