Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Availability: Adds EnableTcpConnectionEndpointRediscovery to true by default #2724

Merged
merged 7 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ public CosmosSerializer Serializer
/// Does not apply if <see cref="ConnectionMode.Gateway"/> is used.
/// </remarks>
/// <value>
/// The default value is false
/// The default value is true
/// </value>
public bool EnableTcpConnectionEndpointRediscovery { get; set; } = false;
public bool EnableTcpConnectionEndpointRediscovery { get; set; } = true;

/// <summary>
/// Gets or sets a delegate to use to obtain an HttpClient instance to be used for HTTPS communication.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task ClientConfigTest()
}

[TestMethod]
public void CleintConfigWithOptionsTest()
public void ClientConfigWithOptionsTest()
{
CosmosClientOptions options = new CosmosClientOptions
{
Expand All @@ -66,7 +66,7 @@ public void CleintConfigWithOptionsTest()
Assert.AreEqual(tcpconfig.ConnectionTimeout, 30);
Assert.AreEqual(tcpconfig.IdleConnectionTimeout, -1);
Assert.AreEqual(tcpconfig.MaxRequestsPerChannel, 30);
Assert.AreEqual(tcpconfig.TcpEndpointRediscovery, false);
Assert.AreEqual(tcpconfig.TcpEndpointRediscovery, true);

GatewayConnectionConfig gwConfig = cosmosClient.ClientConfigurationTraceDatum.GatewayConnectionConfig;
Assert.AreEqual(gwConfig.UserRequestTimeout, 50);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated()
Assert.IsNotNull(clientOptions.Serializer);
Assert.IsNull(clientOptions.WebProxy);
Assert.IsFalse(clientOptions.LimitToEndpoint);
Assert.IsFalse(clientOptions.EnableTcpConnectionEndpointRediscovery);
Assert.IsTrue(clientOptions.EnableTcpConnectionEndpointRediscovery);
Assert.IsNull(clientOptions.HttpClientFactory);
Assert.AreNotEqual(consistencyLevel, clientOptions.ConsistencyLevel);
Assert.IsFalse(clientOptions.EnablePartitionLevelFailover);
Expand All @@ -93,7 +93,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated()
Assert.IsNull(policy.MaxRequestsPerTcpConnection);
Assert.IsNull(policy.MaxTcpConnectionsPerEndpoint);
Assert.IsTrue(policy.EnableEndpointDiscovery);
Assert.IsFalse(policy.EnableTcpConnectionEndpointRediscovery);
Assert.IsTrue(policy.EnableTcpConnectionEndpointRediscovery);
Assert.IsNull(policy.HttpClientFactory);
Assert.AreNotEqual(Cosmos.ConsistencyLevel.Session, clientOptions.ConsistencyLevel);
Assert.IsFalse(policy.EnablePartitionLevelFailover);
Expand Down