dotnet: .NET 4.7.2 (and Windows 10 1803) upgrade - SqlClient timeout exception
From @rossmhk on May 15, 2018 8:29
After upgrading to .NET 4.7.2, a number of Entity Framework queries are now failing against Azure SQL DB. This is confirmed to be not happening on .NET 4.7.1.
System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__180_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.<ExecuteStoreCommandsAsync>d__c.MoveNext()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.<ExecuteStoreCommandsAsync>d__c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.<ExecuteAsync>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
Steps to reproduce
Seems to be a pattern where there a 3 of more tables involved and the EF LINQ expression has an Include statement. For example, one of the simpler examples:
string username = "john";
var user = _context.Users.Include("User_UserRoles.UserRole").Where(u => u.UserName == username).FirstOrDefault();
Further technical details
Operating system: Windows 10 1803 / .NET 4.7.2 IDE: Visual Studio 2017 15.7 / 15.8.0 (Preview 1.1)
Copied from original issue: aspnet/EntityFramework6#538
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 24
@dsikic The security team is working on this urgently with top priority, and targeting ETA is tomorrow Sunday (5/20) for hotfix worldwide. I will keep you updated as frequently as possible on this thread.
@rossmhk @dsikic @divega Thank for the information. I could confirm the SqlTimeOut occured when using 4.7.2 and targeting Azure DB. No issue happened with the same code when using 4.7.1 with Azure DB. Interesting thing is that it works with no error when using 4.7.2 with SQL Server or localDb. This makes me to think that this error might be caused due to encryption (security) feature changed in 4.7.2 for Azure.
@dsikic The link does not seems to be a right one for the hotfix. The hotfix is for Azure DB Server side, not client side. It seems the hotfix was already deployed yesterday (5/20), and I could confirm the repro code worked without any error on 4.7.2 with Azure. Can you please test it on your side, and let me know how it goes?