Azure / Azure/elastic-db-tools

Transient connection error due to connectionStringBuilder[ShardMapUtils.ConnectRetryCount] = 0

Open
#232 1 comment 0 reactions 1 assignee Claimed by @stuartpa View on GitHub
Dominant language
C#
Stars
147
Forks
108
PR merge metrics
No merged PRs in 30d

Description

Hi,

For some reason SQL connection can go wrong and can be resolved if it can try to reconnect. But this library code overrides it and so we are seeing so many issues in prod.
Default ConnectRetryCount is 1, which is overridden to 0 in this library.

// ConnectRetryCount must not be set (default value is 1)
if (ShardMapUtils.IsConnectionResiliencySupported && (int)connectionStringBuilder[ShardMapUtils.ConnectRetryCount] > 1)
{
throw new ArgumentException(
StringUtils.FormatInvariant(
Errors._ShardMap_OpenConnection_ConnectionStringPropertyDisallowed,
ShardMapUtils.ConnectRetryCount),
"connectionString");
}

// Disable connection resiliency if necessary
if (ShardMapUtils.IsConnectionResiliencySupported)
{
[connectionStringBuilder[ShardMapUtils.ConnectRetryCount] = 0;](https://github.com/Azure/elastic-db-tools/blob/master/Src/ElasticScale.Client/ShardManagement/ShardMap/ShardMap.cs)
}

Is there any update planned to make this as configurable. This will help to resolve many issues.

We don't have DDR mapping changing offline so we are okay to set this ConnectRetryCount to > 1.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.