Skip to content

test(transactions): preserve graceful recovery drain budget - #10537

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-fix-transaction-recovery-settle
Aug 12, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-fix-transaction-recovery-settle

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Problem

#10514 correctly stops transaction production immediately after a graceful silo shutdown, but its absolute producer-drain watchdog consequently retained only the 15-second scheduling margin. The active batch contains non-cancellable grain calls whose configured response lifetime is 30 seconds, so a valid in-flight batch can outlive that reduced drain budget.

Solution

Model failure observation and producer drain as explicit allocations within the existing 45-second absolute watchdog. Ungraceful shutdown keeps its 30-second observation window plus 15-second drain margin; graceful shutdown reallocates the skipped observation window to drain, giving active calls the full 45 seconds without increasing the overall watchdog.

Add deterministic coverage for both shutdown-mode allocations and report the individual phase budgets in diagnostics.

Fixes #10529

Microsoft Reviewers: Open in CodeFlow

Keep the absolute failure watchdog unchanged while reallocating the skipped graceful observation window to draining the active producer batch.

Co-authored-by: Copilot App <[email protected]>
Copilot AI lite review requested due to automatic review settings August 12, 2026 02:25

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

This PR adjusts transaction recovery test watchdog budgeting so that a graceful silo shutdown reallocates the skipped failure-observation window into producer drain time, preserving the original absolute watchdog (client response timeout + scheduling margin) while avoiding false timeouts for non-cancellable in-flight calls.

Changes:

  • Introduces explicit timeout budgeting (ObservationWindow, ProducerDrainTimeout, MaximumDuration) via TransactionRecoveryFailureObservation.GetTimeouts(...).
  • Updates the recovery runner to use the explicit budgets, including improved diagnostic logging and updated timeout messages.
  • Adds deterministic unit test coverage validating budget allocation for graceful vs ungraceful shutdown modes.
Show a summary per file
File Description
test/Transactions/Orleans.Transactions.Tests/TransactionRecoveryFailureObservationTests.cs Adds unit test coverage for the new timeout allocation model and updates named arguments to match the new API.
src/Orleans.Transactions.TestKit.Base/TestRunners/TransactionRecoveryTestsRunner.cs Switches runner logic and diagnostics to use the explicit timeout allocations while preserving the overall watchdog.
src/Orleans.Transactions.TestKit.Base/TestRunners/TransactionRecoveryFailureObservation.cs Adds Timeouts record + GetTimeouts helper and updates DetectAsync to accept explicit observation/drain allocations.

Review details

Tip

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

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

@ReubenBond
ReubenBond merged commit 898cffd into dotnet:main Aug 12, 2026
135 of 138 checks passed
@ReubenBond
ReubenBond deleted the rb-fix-transaction-recovery-settle branch August 12, 2026 14:06
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 12, 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.

Transaction recovery graceful shutdown can exceed producer drain deadline

2 participants