Skip to content

Commit 00c2426

Browse files
committed
fix CheckPacket assertion
1 parent 1f57d73 commit 00c2426

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.netcore.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ public void ReadAsyncCallback(IntPtr key, PacketHandle packet, uint error)
492492
bool processFinallyBlock = true;
493493
try
494494
{
495-
Debug.Assert(CheckPacket(packet, source) && source != null, "AsyncResult null on callback");
495+
Debug.Assert((packet.Type == 0 && PartialPacketContainsCompletePacket()) || (CheckPacket(packet, source) && source != null), "AsyncResult null on callback");
496496

497497
if (_parser.MARSOn)
498498
{
@@ -504,7 +504,7 @@ public void ReadAsyncCallback(IntPtr key, PacketHandle packet, uint error)
504504

505505
// The timer thread may be unreliable under high contention scenarios. It cannot be
506506
// assumed that the timeout has happened on the timer thread callback. Check the timeout
507-
// synchrnously and then call OnTimeoutSync to force an atomic change of state.
507+
// synchronously and then call OnTimeoutSync to force an atomic change of state.
508508
if (TimeoutHasExpired)
509509
{
510510
OnTimeoutSync(asyncClose: true);

0 commit comments

Comments
 (0)