You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Driver does not return to gateway on connection timeouts #3528
When a server instance goes down or comes under heavy load, it can begin timing out on prelogin requests. As long as these timeouts take less than the user-configured connection timeout, the driver will keep retrying until the connection timeout is reached. If the driver was routed to the server by a gateway or AOAG listener, these retries are against the routed location. The driver does not return to the gateway for fresh routing instructions.
TransparentNetworkIPResolution is defaulting to "True" for .NET Framework. This enables the "parallel" retry strategy optimized for servers with explicit failover partner configurations. When connecting to azure servers, the parallel strategy prevents us from returning to the gateway. Any customer who uses .NET Framework, connects to an azure sql database, and does not explicitly set TransparentNetworkIPResolution to false in their connection string or via app context switch can face this issue.
Activity
mdaigle commentedon Aug 18, 2025
TransparentNetworkIPResolution is defaulting to "True" for .NET Framework. This enables the "parallel" retry strategy optimized for servers with explicit failover partner configurations. When connecting to azure servers, the parallel strategy prevents us from returning to the gateway. Any customer who uses .NET Framework, connects to an azure sql database, and does not explicitly set TransparentNetworkIPResolution to false in their connection string or via app context switch can face this issue.
Our documentation suggests that TNIR is disabled when connecting to an azure sql server or using certain auth modes, but this is not reflected in the code: https://learn.microsoft.com/en-us/dotnet/api/microsoft.data.sqlclient.sqlconnection.connectionstring?view=sqlclient-dotnet-core-6.0
mdaigle commentedon Aug 18, 2025
The TNIR default value is set as
!LocalAppContextSwitches.DisableTnirByDefaultThat flag is off by default, resulting in
TNIR = truecheenamalhotra commentedon Aug 19, 2025
@saurabh500 for awareness: Any concerns from your perspective in fixing this behavior?
mdaigle commentedon Oct 28, 2025
Determined that this behavior was due to TNIR. Disabling TNIR gives the expected behavior.
Warn about TNIR default behavior against Azure SQL from .NET Framework