Repository navigation
feat(actor): add opt-in timer-discard shutdown policy - #488
Conversation
PR SummaryMedium Risk Overview Callers can pass Docs (Actor README, arc42 ADR-6) and API approval reflect the additive surface. New tests cover all execution modes, reentrant/off-loop shutdown, timers that become due mid-callback, pre-loop stop, and blocked context delivery. Reviewed by Cursor Bugbot for commit 9f6441a. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What does this change?
Adds an explicit
ActorShutdownPolicy.DiscardPendingTimersconstructor option: finish accepted mailbox work while discarding pending timers, including already due ones. The original constructor and itsDrainDueTimersdefault stay unchanged.Timer selection and disposal share a short gate; callbacks and synchronization-context marshaling run outside it. A callback selected before disposal may still complete. The new policy does not complete tasks that depend on discarded timers; callers still need lifetime cancellation. XML docs, Actor README and ADR-6 describe the contract. The generated API approval adds only the enum and a three-argument constructor.
Closes #351. The prior minor fixes remain intact; this implements the newly authorized additive alternative rather than changing the legacy default.
Type of change
feat— new behaviour (minor release)fix/perfdocs/test/refactor/chore/ciValidation
Checklist
-p:CI=true, test (net10.0),dotnet format --verify-no-changes, and pack +eng/verify-packages.pyall pass locally