GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(testing): isolate reminder event continuations by ReubenBond · Pull Request #10899 · dotnet/orleans

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 28, 2026 •
edited by dotnet-policy-service Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Problem

ReminderTestKit_StaleRefreshCannotRestoreUnregisteredReminder can resume directly on the LocalReminderService diagnostic-event thread after awaiting ReminderServiceStarted. The failed CI artifact shows the grain turn starting immediately and then waiting 30 seconds for its nested local reminder-service request, without reaching reminder storage. The existing Rx ToTask conversion permits synchronous caller continuations at this scheduler boundary.

Solution

Complete diagnostic event waits through task sources configured with RunContinuationsAsynchronously, while preserving replay, filtering, cancellation, error propagation, and subscription cleanup. Add a regression which verifies that a service-start waiter cannot run an ExecuteSynchronously continuation on the event emitter thread.

Rationale

Reminder diagnostic waits are phase barriers. Resuming consumers independently from the runtime event producer keeps subsequent grain calls outside the reminder-service scheduler turn and applies the same continuation guarantee already used by the observer's lifecycle-state waiters.

Fixes #10893

Microsoft Reviewers: Open in CodeFlow

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI lite review requested due to automatic review settings August 28, 2026 08:40
Copilot started reviewing on behalf of ReubenBond August 28, 2026 08:40
View session
Copilot AI reviewed Aug 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot review overview

Review tier: Lite
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity test/​Orleans.Testing.Reminders/​ReminderDiagnosticObserver.cs — WaitForEventAsync subscribes with only OnNext/OnError. If the observable completes without…
What changed in this PR

This PR addresses a flaky reminders test by ensuring that waits on reminder diagnostic events do not resume continuations inline on the diagnostic event emitter thread, aligning reminder diagnostic wait behavior with other lifecycle-state waiters.

Changes:

  • Replace Rx FirstAsync(...).ToTask(...) conversions with a TaskCompletionSource-based wait using RunContinuationsAsynchronously.
  • Ensure cancellation and error propagation disposes subscriptions and completes the returned task appropriately.
  • Add a regression test asserting that an ExecuteSynchronously continuation attached to WaitForReminderServiceStartedAsync does not run inline.
File Description
test/​Orleans.Testing.Reminders/​ReminderDiagnosticObserver.cs Introduces WaitForEventAsync using TaskCompletionSource(...RunContinuationsAsynchronously) and refactors reminder/service wait helpers to use it.
test/​Orleans.Reminders.Tests/​Diagnostics/​ReminderEventsTests.cs Adds a regression test to validate that service-start wait continuations do not run inline on the event emission thread.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/Orleans.Testing.Reminders/ReminderDiagnosticObserver.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI review requested due to automatic review settings August 28, 2026 09:35
Copilot started reviewing on behalf of ReubenBond August 28, 2026 09:36
View session
Copilot AI reviewed Aug 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot review overview

Review tier: Lite
Findings: None

Issues resolved since last review (1)
Severity Finding
Medium severity test/​Orleans.Testing.Reminders/​ReminderDiagnosticObserver.cs — WaitForEventAsync subscribes with only OnNext/OnError. If the observable completes without… View resolved comment
Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

test/Orleans.Testing.Reminders/ReminderDiagnosticObserver.cs:335

  • WaitForEventAsync calls predicate(value) inside the subscription callback without handling exceptions. If the predicate throws, the exception will escape the Rx OnNext delegate (potentially crashing the event producer) and the returned task will never complete or clean up its registration/subscription. This is a semantic regression compared to FirstAsync(predicate) which faults the sequence when the predicate throws.
            value =>
            {
                if (!predicate(value))
                {
                    return;

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ReubenBond added 3 commits August 28, 2026 07:20
@ReubenBond
fix(testing): avoid inline reminder observer continuations
6060add
@ReubenBond
fix(testing): handle completed diagnostic streams
b0c6c2c
@ReubenBond
fix(testing): reconcile reminder observer rebase
758a6ac
Copilot AI review requested due to automatic review settings August 28, 2026 14:30
@ReubenBond
ReubenBond force-pushed the rb-fix-reminder-stale-refresh-timeout-ecb branch from f6040e8 to 758a6ac Compare August 28, 2026 14:30
Copilot started reviewing on behalf of ReubenBond August 28, 2026 14:31
View session
Copilot AI reviewed Aug 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot review overview

Review tier: Lite
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity test/​Orleans.Testing.Reminders/​ReminderDiagnosticObserver.cs — The cancellation callback disposes the subscription and cancels the task, but the…

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/Orleans.Testing.Reminders/ReminderDiagnosticObserver.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
fix(testing): release cancellation registrations
80345fc
Copilot AI review requested due to automatic review settings August 28, 2026 14:44
Copilot started reviewing on behalf of ReubenBond August 28, 2026 14:45
View session
Copilot AI reviewed Aug 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot review overview

Review tier: Lite
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity test/​Orleans.Testing.Reminders/​ReminderDiagnosticObserver.cs — WaitForEventAsync evaluates predicate(value) directly inside the observer OnNext callback. If…
Issues resolved since last review (1)
Severity Finding
Medium severity test/​Orleans.Testing.Reminders/​ReminderDiagnosticObserver.cs — The cancellation callback disposes the subscription and cancels the task, but the… View resolved comment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/Orleans.Testing.Reminders/ReminderDiagnosticObserver.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
fix(testing): contain reminder predicate failures
f73148e
Copilot AI review requested due to automatic review settings August 28, 2026 14:52
Copilot started reviewing on behalf of ReubenBond August 28, 2026 14:53
View session
Copilot AI reviewed Aug 28, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot review overview

Review tier: Lite
Findings: None

Issues resolved since last review (1)
Severity Finding
Medium severity test/​Orleans.Testing.Reminders/​ReminderDiagnosticObserver.cs — WaitForEventAsync evaluates predicate(value) directly inside the observer OnNext callback. If… View resolved comment
Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

test/Orleans.Reminders.Tests/Diagnostics/ReminderEventsTests.cs:58

  • The assertion Assert.NotEqual(emitterThread, continuationThread) is currently comparing the continuation thread against the test thread (the one calling EmitReminderServiceStarted). TaskCreationOptions.RunContinuationsAsynchronously guarantees the continuation is not invoked inline on completion, but it does not guarantee it will run on a different managed thread than the caller (a ThreadPool thread can dequeue its own queued work later). This can make the regression test flaky and fail even when continuations are correctly asynchronous.

A more robust regression is to emit the event from a dedicated non-ThreadPool Thread and assert the continuation does not run on that emitter thread.

        ReminderEvents.EmitReminderServiceStarted(siloAddress);

        Assert.True(continuationRan.Wait(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken));
        Assert.NotEqual(emitterThread, continuationThread);
    }

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ReubenBond
ReubenBond merged commit 20f8b25 into dotnet:main Aug 28, 2026
74 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
ReubenBond deleted the rb-fix-reminder-stale-refresh-timeout-ecb branch August 28, 2026 15:48
This was referenced Aug 29, 2026
Bump the orleans-packages group with 7 updates csrakowski/FeedManager#28
Merged
Bump the dotnet-dependencies group with 1 update dills122/sandtable#67
Merged
Bump the dotnet group with 2 updates Kuestenlogik/Surgewave.Connectors#20
Merged
@ReubenBond ReubenBond mentioned this pull request Aug 30, 2026
Flaky test: reminder lifecycle join times out reconciling topology #10928
Closed
This was referenced Aug 31, 2026
chore(deps): Bump the nuget-patch-and-minor group with 13 updates petesramek/microservices-vs-virtual-actors#7
Closed
chore: Bump Microsoft.Orleans.Persistence.Memory and Microsoft.Orleans.Runtime managedcode/Communication#151
Closed
chore: Bump Microsoft.Orleans.Runtime from 10.2.2 to 10.3.1 managedcode/Communication#152
Closed
This was referenced Sep 9, 2026
Bump the dotnet group with 7 updates IvanMarkitan/dotnet-docs#846
Open
Bump the dotnet group with 5 updates BillWagner/docs#9804
Closed
Bump the dotnet group with 4 updates BillWagner/docs#9805
Closed
Bump the dotnet group with 4 updates BillWagner/docs#9806
Closed
Bump the dotnet group with 5 updates BillWagner/docs#9807
Closed
Bump the dotnet group with 7 updates zbalkan/docs#2339
Closed
Bump the dotnet group with 5 updates zbalkan/docs#2340
Closed
Bump the dotnet group with 6 updates zbalkan/docs#2341
Closed
Bump the dotnet group with 10 updates zbalkan/docs#2347
Open
chore(deps): Bump the nuget-patch-and-minor group with 25 updates petesramek/microservices-vs-virtual-actors#9
Closed
chore(deps): Bump Meziantou.Analyzer and 12 others petesramek/microservices-vs-virtual-actors#10
Closed
chore: Bump ManagedCode.Orleans.RateLimiting.Server and 4 others managedcode/Communication#160
Closed
Bump the dotnet group with 4 updates IvanMarkitan/dotnet-docs#869
Open
Bump the dotnet group with 6 updates IvanMarkitan/dotnet-docs#870
Open
Bump the dotnet group with 7 updates IvanMarkitan/dotnet-docs#877
Open
This was referenced Sep 16, 2026
Bump the dotnet group with 7 updates zbalkan/docs#2373
Open
Bump the dotnet group with 5 updates zbalkan/docs#2377
Open
Bump the dotnet group with 6 updates zbalkan/docs#2393
Open
Bump Microsoft.Orleans.Reminders and Microsoft.Orleans.Sdk en-gen/Wayfinder#266
Open
Bump Microsoft.Orleans.Reminders from 10.2.2 to 10.3.1 en-gen/Wayfinder#267
Closed
Bump Microsoft.Orleans.Reminders and Microsoft.Orleans.Reminders.AzureStorage en-gen/Wayfinder#268
Open
chore: Bump the orleans group with 2 updates pathosDev/actor-ts#1607
Closed
chore: Bump the minor-and-patch group with 3 updates pathosDev/actor-ts#1608
Merged
chore(deps): Bump the nuget-patch-and-minor group with 26 updates petesramek/microservices-vs-virtual-actors#11
Merged
chore(deps): Bump Meziantou.Analyzer and 24 others petesramek/microservices-vs-virtual-actors#12
Merged
Bump Microsoft.Orleans.Streaming from 10.2.0 to 10.3.1 Mystikweb/Orleans.Streams.Confluent#32
Merged
Bump the dotnet group with 7 updates IvanMarkitan/dotnet-docs#999
Closed
This was referenced Sep 23, 2026
Bump the dotnet group with 10 updates zbalkan/docs#2533
Closed
Bump the nuget group with 10 updates dotnet/docs#56226
Merged
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Flaky test: ReminderTestKit_StaleRefreshCannotRestoreUnregisteredReminder times out

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ReubenBond
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.