Skip to content

Conversation

@sanych-sun
Copy link
Member

No description provided.

@sanych-sun sanych-sun requested a review from papafe December 15, 2025 21:15
@sanych-sun sanych-sun requested a review from a team as a code owner December 15, 2025 21:15
Copilot AI review requested due to automatic review settings December 15, 2025 21:15
@sanych-sun sanych-sun added the feature Adds new user-facing functionality. label Dec 15, 2025
Copy link
Contributor

Copilot AI left a comment

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 implements support for avoiding connection pool clearing when the server connection rate limiter triggers, adding the "SystemOverloadedError" and "RetryableError" labels to network errors during connection establishment or handshake. This allows the driver to apply backpressure instead of unnecessarily clearing the pool.

  • Added error label support to identify rate limiter backpressure scenarios
  • Modified pool clearing logic to skip clearing when SystemOverloadedError is present
  • Updated test specifications to reflect the new behavior

Reviewed changes

Copilot reviewed 75 out of 75 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/MongoDB.Driver/Core/Connections/BinaryConnection.cs Adds backpressure error labels to network errors during connection establishment/handshake
src/MongoDB.Driver/Core/Servers/DefaultServer.cs Prevents pool clearing when SystemOverloadedError label is present
src/MongoDB.Driver/Core/Misc/Feature.cs Adds IngressConnectionEstablishmentRateLimiter feature flag for server version 8.0+
tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/prose-tests/ServerDiscoveryProseTests.cs Adds prose test validating pool isn't cleared during backpressure
tests/MongoDB.Driver.Tests/Specifications/connection-monitoring-and-pooling/ConnectionMonitoringAndPoolingTestRunner.cs Updates test runner to handle interruptInUseConnections parameter
tests/MongoDB.Driver.Tests/Specifications/UnifiedTestSpecRunner.cs Removes skip exception for previously flaky pool-clear tests
specifications/server-discovery-and-monitoring/tests/unified/.yml/.json Updates schema versions from 1.10 to 1.4 and test descriptions
specifications/connection-monitoring-and-pooling/tests/cmap-format/.yml/.json Renames closeInUseConnections to interruptInUseConnections throughout tests
specifications/load-balancers/tests/.yml/.json Changes test expectations from network errors to server errors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// https://github.com/mongodb/specifications/blob/a8d34be0df234365600a9269af5a463f581562fd/source/server-discovery-and-monitoring/server-discovery-and-monitoring-tests.md?plain=1#L176
[Theory]
[ParameterAttributeData]
public async Task Connection_Pool_Backpressure([Values(true, false)]bool async)
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space between parameter attribute and parameter type. Add space after closing bracket of Values attribute.

Suggested change
public async Task Connection_Pool_Backpressure([Values(true, false)]bool async)
public async Task Connection_Pool_Backpressure([Values(true, false)] bool async)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adds new user-facing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant