Skip to content

fix(reminders): always start the first retry attempt - #10819

Merged
ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-flaky-reminder-retry-hard-bounds
Aug 26, 2026
Merged

ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-flaky-reminder-retry-hard-bounds

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Problem

The reminder TestKit retry policy starts its timeout stopwatch before entering the retry loop. Under scheduler pressure, a short deadline can expire before the first operation is invoked, producing a timeout diagnostic with attempts=0 even though the policy is intended to hard-bound the first attempt.

Solution

Always start and count the first operation, then apply the remaining deadline to its completion. Subsequent attempts continue to start only while time remains. The regression test uses a one-tick timeout and verifies that the blocked operation is invoked exactly once and reported as attempts=1.

Rationale

Attempt diagnostics now consistently describe operations which were started. The retry deadline remains hard-bounded, while scheduler delays before the first invocation can no longer skip the first attempt or make its diagnostic nondeterministic.

Fixes #10812

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings August 25, 2026 09:29

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

Fixes reminder retry timing so the first operation is always invoked and counted.

Changes:

  • Adjusts first-attempt timeout handling.
  • Adds regression coverage for invocation count and diagnostics.

Review finding: Moderate (4 votes) — Recompute the remaining deadline after invoking the operation to prevent accepting successful results after the hard deadline.

Show a summary per file
File Summary
test/Orleans.Reminders.TestKit.Tests/ReminderTableRetryPolicyTests.cs Adds regression coverage for the first attempt.
src/Orleans.Reminders.TestKit/ReminderTableRetryPolicy.cs Updates retry timing and attempt accounting.

Review details

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/Orleans.Reminders.TestKit/ReminderTableRetryPolicy.cs Outdated
Copilot AI review requested due to automatic review settings August 25, 2026 09:52

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.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage

77.63% line coverage - 97,599 / 125,728 lines

Coverage details

@ReubenBond
ReubenBond force-pushed the rb-flaky-reminder-retry-hard-bounds branch from 7553ebc to 3132dcc Compare August 26, 2026 08:15
Copilot AI review requested due to automatic review settings August 26, 2026 08:15

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.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@ReubenBond
ReubenBond merged commit 889647f into dotnet:main Aug 26, 2026
139 of 141 checks passed
@ReubenBond
ReubenBond deleted the rb-flaky-reminder-retry-hard-bounds branch August 26, 2026 14:23
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky ReminderTableRetryPolicyTests_UniformPolicy_HardBoundsTheFirstAttempt on net8.0

2 participants