Handle missing Cosmos reminder deletes#10037
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts reminder-table semantics to better handle “missing delete” scenarios in the Cosmos reminder table implementation, making unregister operations more idempotent and adding coverage to validate shared reminder-table expectations.
Changes:
- Treat Cosmos reminder deletes which return
NotFoundthe same asPreconditionFailed(unsuccessful remove) inCosmosReminderTable.RemoveRow. - Update
LocalReminderService.UnregisterReminderto treat “already removed from the table” as a successful unregister. - Add Cosmos-based
ReminderTableTestsBasecoverage to validate shared reminder-table behavior (including delete-after-delete returningfalse).
Show a summary per file
| File | Description |
|---|---|
| test/Extensions/Orleans.Cosmos.Tests/CosmosRemindersTableTests.cs | Adds reminder-table conformance tests for the Cosmos reminder table provider. |
| src/Orleans.Reminders/ReminderService/LocalReminderService.cs | Makes unregister idempotent when the reminder row is already absent from the table. |
| src/Azure/Orleans.Reminders.Cosmos/CosmosReminderTable.cs | Returns false (not exception) when delete encounters NotFound, aligning with expected reminder-table semantics. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 0
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
LocalReminderServicetreat already-removed reminders as a successful unregisterTesting
dotnet build test\Extensions\Orleans.Cosmos.Tests\Orleans.Cosmos.Tests.csproj -f net8.0 -nologo -v minimal --no-restoredotnet test test\Extensions\Orleans.Cosmos.Tests\Orleans.Cosmos.Tests.csproj -f net8.0 -nologo -v minimal --no-build --filter "FullyQualifiedName~CosmosRemindersTableTests"dotnet test test\Orleans.Reminders.Tests\Orleans.Reminders.Tests.csproj -nologo -v minimal --no-restore --filter "FullyQualifiedName~ReminderTests_TableGrain.Rem_Grain_Basic_StopByRef|FullyQualifiedName~ReminderTests_TableGrain.Rem_Grain_Basic_ListOps|FullyQualifiedName~MinimalReminderTests.MinimalReminderInterval"Microsoft Reviewers: Open in CodeFlow