SQL Server 2012远程连接给出Timeout和ASYNC_NETWORK_IO错误

Cro*_*rts 5 .net sql-server networking tcp-ip sql-server-2012

我遇到连接到SQL Server 2012的远程实例的服务的问题.

.NET 2.0服务在客户端计算机上运行,​​它使用TCP/IP连接到当前运行SQL Server 2012实例的远程Web服务器.该Web服务器曾经是Windows Server 2003和SQL Server 2005并已升级6几个月前没有任何问题.然后,该服务检查是否有任何需要下载的数据.

客户端机器

  • Windows Server 2003

网络服务器

  • Windows Server 2012
  • SQL Server 2012

直到上周五它突然停止工作并且它给出以下错误日志消息,这运行正常5年以上

Event Type: Warning
Event Source:   
Event Category: None
Event ID:   0
Date:       21/05/2013
Time:       16:45:11
User:       N/A
Computer:   
Description:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: 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(TdsParserStateObject stateObj)
   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.TdsParserStateObject.ReadByteArray(Byte[] buff, Int32 offset, Int32 len)
   at System.Data.SqlClient.TdsParserStateObject.ReadUInt32()
   at System.Data.SqlClient.TdsParser.ReadSqlValueInternal(SqlBuffer value, Byte tdsType, Int32 typeId, Int32 length, TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ReadColumnData()
   at System.Data.SqlClient.SqlDataReader.ReadColumnHeader(Int32 i)
   at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
   at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
   at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
   at RedBlack.Data.Synchronisation.SyncManager.UpsertRecords(String sourceSelect, String destTable, String[] destFields, List`1 relations)
   at General.CyPro.Application.WebSynchronisation.SyncRoutines.FetchOrders(UpsertFlags upsertOptions)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at RedBlack.CyPro.Application.WebSynchronisation.Job.Run(Object[] args)
...
System.Data.SqlClient.SqlException: 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(TdsParserStateObject stateObj)
   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.TdsParserStateObject.ReadByteArray(Byte[] buff, Int32 offset, Int32 len)
   at System.Data.SqlClient.TdsParserStateObject.ReadUInt32()
   at System.Data.SqlClient.TdsParser.ReadSqlValueInternal(SqlBuffer value, Byte tdsType, Int32 typeId, Int32 length, TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ReadColumnData()
   at System.Data.SqlClient.SqlDataReader.ReadColumnHeader(Int32 i)
   at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
   at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
   at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
   at RedBlack.Data.Synchronisation.SyncManager.UpsertRecords(String sourceSelect, String destTable, String[] destFields, List`1 relations)
   at General.CyPro.Application.WebSynchronisation.SyncRoutines.FetchOrders(UpsertFlags upsertOptions)
Run Code Online (Sandbox Code Playgroud)

我已经检查了Web服务器上的活动监视器,并且在运行查询时,它使用WAIT_TYPE ASYNC_NETWORK_IO暂停.

我已经运行查询,它试图在远程连接到Web服务器实例的客户端服务器上的Management Studio中手动运行它运行大约40秒返回2600+行,然后它给我以下错误

Msg 121, Level 20, State 0, Line 0
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)
Run Code Online (Sandbox Code Playgroud)

我在Management Studio中的计算机上运行相同的查询,远程连接到Web服务器实例,并在0.312秒内返回完整的4000行.

我无法想象这一点,因为在我看来,这是一种网络问题.客户硬件技术人员检查了网络,并表示一切都很好,只要他们担心.

如果您需要更多信息,请告诉我

谢谢

Cro*_*rts 3

该问题已得到解决,最终证明是客户端互联网的问题。我不知道所有细节,但英国电信在交易所发现了一个问题,一旦问题得到解决,程序就重新开始工作。