Skip to content

fix(clustering): synchronize torn point-read fault injection - #11334

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-fix-torn-read-fault-injection
Sep 19, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-fix-torn-read-fault-injection

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Fixes #11333.

The torn point-read helper counted full setup reads only inside its point-read-only path, so the counter stayed zero. Readers could finish before the writer armed: either all readers escaped and the writer waited for ReadStarted until scenario cancellation, or the changed-row reader escaped while a sentinel/missing reader released the writer.

Observe full setup and round-boundary reads in both torn-read modes, then gate only the selected read kind. This makes the intended old-rows/new-version observation deterministic while preserving the full-read handshake and the canonical Status rejection.

Add bounded reader-first, writer-first, and target-reader-first regressions for both point/full modes. They join all actual operations before fixture teardown and assert the old canonical rows, next table version, changed token, completed handshake, and Status diagnostic. The original fault test now outputs the complete conformance exception before asserting its diagnostic.

The historical 4 ms failure has only a truncated exception in its retained artifact, so its exact diagnostic remains unconfirmed. The new target-reader-first case independently reproduces a fast escape from this handshake. The existing scenario timeout, stale-table/canonical corruption checks, provider behavior, and fixture lifecycle guarantees remain intact.

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings September 19, 2026 05:49

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.

Copilot review overview

🟡 Changes recommended

The torn-read counter logic still does not increment for point-read paths (risking the same race) and there is a new potential NRE in test output logging.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

This PR fixes a scheduling race in the clustering conformance test kit’s deliberate torn-read fault injection (especially for point reads) to make the “old rows with new version” observation deterministic, and adds new bounded regressions to validate the handshake and diagnostics.

Changes:

  • Adjusts FaultyMembershipTable.Read to observe setup/round-boundary full reads for both torn-read fault modes and only gate the selected read kind.
  • Expands coverage with controlled reader/writer ordering regression tests for both point-read and full-read modes.
  • Improves failure diagnostics by writing the full conformance exception to test output before asserting on the message.
File Description
test/​Orleans.Clustering.TestKit.Tests/​FaultyMembershipTableTests.cs Adds controlled scheduling regressions for torn-read injection and improves diagnostic output for the original test.
test/​Orleans.Clustering.TestKit.Tests/​FaultyMembershipTable.cs Refactors torn-read fault read-path logic to count setup/round-boundary reads across fault modes and gate only the targeted read kind.

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

@github-actions

Copy link
Copy Markdown
Contributor

Code coverage

Metric Pull request Current main Variance
Lines 82.78% (114,859 / 138,756) 82.84% (114,944 / 138,756) -0.0613 pp
Branches 72.05% (33,313 / 46,238) 72.12% (33,348 / 46,238) -0.0757 pp

Report-only conclusion: regressed.

The current-main baseline is commit 598c0d2813 and uses the same reviewed coverage matrix.

Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities.

The comparison remains report-only while normal line and branch variance is calibrated.

Coverage details

@ReubenBond
ReubenBond marked this pull request as ready for review September 19, 2026 06:12
@ReubenBond
ReubenBond merged commit 79c24eb into dotnet:main Sep 19, 2026
73 checks passed
@ReubenBond
ReubenBond deleted the rb-fix-torn-read-fault-injection branch September 19, 2026 15:25
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 20, 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.

test(clustering): torn point-read conformance fault injection can time out in BVT

2 participants