Skip to content

refactor: gate ADO.NET receiver work - #11265

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-refactor-gate-adonet-receiver-work
Sep 16, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-refactor-gate-adonet-receiver-work

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Problem

AdoNetQueueAdapterReceiver maintains a shutdown flag, a locked operation count, and a new completion source for every busy burst. Confirmation preparation also occurs before its operation-release finally, allowing preparation failures to leave shutdown waiting for an operation which has already failed.

Solution

Use the merged AdmissionGate with one scoped admission for each complete dequeue or confirmation operation. Shutdown closes admission synchronously, waits for the actual drain within the existing timeout, then releases pending messages. Retain the receipt dictionary lock, receipt-version checks, rejection results, and existing query/timeout logging.

Grant only Orleans.Streaming.AdoNet access to Core internals. Extend the provider-independent lifecycle suite with deterministic bookkeeping boundaries, both concurrent completion orders, post-close rejection, query/conversion/preparation faults, and timeout behavior. Document the receiver's shutdown and redelivery behavior in its package README.

Rationale

Scoped ownership covers conversion and receipt bookkeeping as well as database work, while the gate supplies terminal admission and drain accounting without per-burst completion sources. This PR is independent of other AdmissionGate adoption work and is based directly on main.

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings September 16, 2026 00:47

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

🟢 Approval recommended

No unresolved issues were identified that would block approval.

Review tier: Lite
Findings: None

What changed in this PR

Refactors ADO.NET receiver lifecycle management around AdmissionGate, with expanded tests and documentation.

Changes:

  • Gates dequeue and confirmation operations during shutdown.
  • Adds lifecycle, fault, concurrency, rejection, and timeout tests.
  • Documents shutdown and redelivery behavior.
File Description
test/​Extensions/​Orleans.AdoNet.Tests/​Streaming/​AdoNetQueueAdapterReceiverTests.cs Adds lifecycle and failure-mode coverage.
src/​Orleans.Core/​Orleans.Core.csproj Grants the ADO.NET provider access to AdmissionGate.
src/​AdoNet/​Orleans.Streaming.AdoNet/​README.md Documents shutdown and redelivery semantics.
src/​AdoNet/​Orleans.Streaming.AdoNet/​AdoNetQueueAdapterReceiver.cs Implements admission-gated receiver lifecycle handling.

💡 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 81.92% (111,288 / 135,846) 81.87% (111,253 / 135,883) +0.0481 pp
Branches 70.96% (31,862 / 44,900) 70.93% (31,854 / 44,912) +0.0368 pp

Report-only conclusion: improved.

The current-main baseline is commit 8c4887aba9 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 16, 2026 01:11
@ReubenBond
ReubenBond merged commit d0fd6c1 into dotnet:main Sep 16, 2026
73 checks passed
@ReubenBond
ReubenBond deleted the rb-refactor-gate-adonet-receiver-work branch September 16, 2026 01:43
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 16, 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.

2 participants