Connection times out when you use AlwaysOn availability group listener with MultiSubnetFailover parameter

Vzťahuje sa na: Windows Server 2008 R2 Service Pack 1Windows Server 2008 R2 EnterpriseWindows Server 2008 R2 Datacenter Viac

Symptoms


When you try to connect to Microsoft SQL Server 2012 through an AlwaysOn availability group listener from a client application, you may experience a logon time-out error message.

For example, when you use SqlCmd command, you may receive the following error message:

Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
[Microsoft][SQL Server Native Client 11.0]Unable to complete login process due to delay in opening server connection

When you use a Microsoft .NET Framework 3.5-based or Microsoft .NET Framework 4.0-based application by using the .Net Framework Data provider for SQL Server, you may receive the following error message:

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
at System.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(Boolean encrypt, Boolean trustServerCert, Boolean& marsCapable)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)


Note If you increase the login time-out to 30 seconds, the client application takes approximately 20 seconds to connect successfully.

These symptoms occur when the following conditions are true:
  • Your availability group is defined in a multi-subnet.
  • You specified the MultiSubnetFailover parameter when you connect.
  • You have an active Transport Driver Interface (TDI) filter driver that is installed on the client application workstation.

Cause


This issue occurs because the Tdx.sys driver does not handle the Closesocket() function correctly when the function is called in the middle of a TCP/IP handshake.

Resolution


Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this hotfix, you must be running Windows 7 SP1 or Windows Server 2008 R2 SP1.

For more information about how to obtain a Windows 7 or Windows Server 2008 R2 service pack, click the following article number to view the article in the Microsoft Knowledge Base:

976932 Information about Service Pack 1 for Windows 7 and for Windows Server 2008 R2

Registry information

To apply this hotfix, you do not have to make any changes to the registry.

Restart requirement

You must restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace a previously released hotfix.

Workaround


To work around this issue, use one of the following methods:
  • Increase your application’s login time-out to 30 seconds.
  • The TDI feature is deprecated in Windows Vista, Windows Server 2008, or a later version of Windows. You can use the Windows Filtering Platform (WFP)-based drivers instead. Contact the vendor of the installed TDI filter driver to request information about upgrades to the product that implement the new Windows Filtering Platform. Upgrade the product, if it is possible.
  • Replace the TDI by using a comparable product that has implemented the Windows Filtering Platform.
  • Set the RegisterAllProvidersIP property to 0 for the availability group listener resource in the Windows cluster. When the RegisterAllProvidersIP property is set to 0, you do not have to specify the MultiSubnetFailover parameter. For more information about this workaround, go to the following MSDN website:
    Create or Configure an Availability Group Listener (SQL Server)

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More Information


For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.