Repository navigation
fix(clustering): synchronize torn point-read fault injection - #11334
Conversation
There was a problem hiding this comment.
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
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.Readto 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.
Code coverage
Report-only conclusion: regressed. The current-main baseline is commit 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 |

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
ReadStarteduntil 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
Statusrejection.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
Statusdiagnostic. 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