Skip to content

fix(reminders): fix scheduling for long due times - #10260

Merged
ReubenBond merged 7 commits into
dotnet:mainfrom
ReubenBond:reubenbond-fix-arbitrary-time-waits
Jul 14, 2026
Merged

ReubenBond merged 7 commits into
dotnet:mainfrom
ReubenBond:reubenbond-fix-arbitrary-time-waits

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Fixes #10249.

Add internal TimeProvider extensions which wait in timer-safe chunks. Absolute deadlines are recomputed after each chunk, and relative delays use provider timestamps so delays up to TimeSpan.MaxValue remain cancellable without overflowing DateTime.

Use AsyncTimer for local reminders and recalculate each wait from the reminder's StartAt and Period. This supports both long initial delays and long periods while preserving cadence after late delivery, schedule updates, and shutdown cancellation.

Add fake-time regression coverage for the native timer boundary, 60-day reminder periods, overdue cadence, and overflow limits.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 8918d343-e257-480a-a64f-994f87c8fec1
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 8918d343-e257-480a-a64f-994f87c8fec1
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 8918d343-e257-480a-a64f-994f87c8fec1
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 8918d343-e257-480a-a64f-994f87c8fec1
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 8918d343-e257-480a-a64f-994f87c8fec1
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 8918d343-e257-480a-a64f-994f87c8fec1
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 8918d343-e257-480a-a64f-994f87c8fec1
@ReubenBond ReubenBond changed the title Fix reminder scheduling for long due times fix(reminders): fix scheduling for long due times Jul 14, 2026
@ReubenBond
ReubenBond merged commit 47c5307 into dotnet:main Jul 14, 2026
117 of 119 checks passed
@ReubenBond
ReubenBond deleted the reubenbond-fix-arbitrary-time-waits branch July 14, 2026 18:05
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.

Reminders with due times over ~49.7 days silently never fire and fault the reminder service on shutdown (10.2.0 regression via #10040)

1 participant