Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
609 views
in Technique[技术] by (71.8m points)

.net - SqlDataReader hangs on GetValue() method and SNIReadSyncOverAsync

We have an extremely weird problem at hand. The .Net SqlDataReader object gets stuck while reading a value on GetValue() method. There are no exceptions and it does not timeout for at least more than 10 minutes which is really long time. After more than 10 minutes, it throws this error:

General Exception - !ET:SqlException{CRLF}!M:Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.{CRLF}General Exception - !ET:Win32Exception{CRLF}!M:The wait operation timed out{CRLF}!

Stack trace obtained through process dump.

000000001b2ee6f8 0000000076eabe7a [InlinedCallFrame: 000000001b2ee6f8] .SNIReadSyncOverAsync(SNI_ConnWrapper*, SNI_Packet**, Int32) 000000001b2ee6f8 000007fef35a3ab1 [InlinedCallFrame: 000000001b2ee6f8] .SNIReadSyncOverAsync(SNI_ConnWrapper*, SNI_Packet**, Int32) 000000001b2ee6d0 000007fef35a3ab1 DomainBoundILStubClass.IL_STUB_PInvoke(SNI_ConnWrapper*, SNI_Packet**, Int32) 000000001b2ee7a0 000007fef358a35f SNINativeMethodWrapper.SNIReadSyncOverAsync(System.Runtime.InteropServices.SafeHandle, IntPtr ByRef, Int32) 000000001b2ee810 000007fef358a07e System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync() 000000001b2ee8c0 000007fef3589f90 System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket() 000000001b2ee900 000007fef358a760 System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer() 000000001b2ee930 000007fef358d8cb System.Data.SqlClient.TdsParser.TryGetTokenLength(Byte, System.Data.SqlClient.TdsParserStateObject, Int32 ByRef) 000000001b2ee980 000007fef359de78 System.Data.SqlClient.TdsParser.TryGetDataLength(System.Data.SqlClient.SqlMetaDataPriv, System.Data.SqlClient.TdsParserStateObject, UInt64 ByRef) 000000001b2ee9c0 000007fef359dce3 System.Data.SqlClient.TdsParser.TryProcessColumnHeaderNoNBC(System.Data.SqlClient.SqlMetaDataPriv, System.Data.SqlClient.TdsParserStateObject, Boolean ByRef, UInt64 ByRef) 000000001b2eea40 000007fef359da4c System.Data.SqlClient.SqlDataReader.TryReadColumnInternal(Int32, Boolean) 000000001b2eeae0 000007fef359d900 System.Data.SqlClient.SqlDataReader.TryReadColumn(Int32, Boolean, Boolean) 000000001b2eeb50 000007fef359d81b System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32) 000000001b2eeb90 000007fef359d7c7 System.Data.SqlClient.SqlDataReader.GetValue(Int32)

This is surely not a database locking problem because what we observed is it gets past ExecuteReader() method. We can also see in SQL profiler that original command has completed successfully. It is only while iterating through records and reading values that it gets stuck. This happens randomly every 10-15 days.

Has someone faced issue like this before? What could be the reason?

I already stackoverflow thread but it did not offer solution. Could it be a network connectivity issue? Why does it not timeout?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...