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

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

Open
jagwaran opened this issue Sep 18, 2023 · 1 comment
Assignees

Comments

@jagwaran
Copy link

jagwaran commented Sep 18, 2023

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.

@stuartpa
Copy link
Contributor

stuartpa commented Oct 9, 2023

@jagwaran do you feel comfortable preparing a PR to provide a solution here?

@stuartpa stuartpa self-assigned this Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants