Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Data.SqlClient.SqlException: Execution Timeout Expired during EndExecuteNonQueryAsync #2471

Open
gidasaramsft opened this issue Apr 24, 2024 · 1 comment
Labels
ℹ️ Needs more Info Waiting on additional information

Comments

@gidasaramsft
Copy link

We are using Microsoft.SqlClient 5.2.0 - We have couple of pipelines that run DML (update/delete/insert) queries on a SQL database.
Recently we are intermittently hitting the below error when running the pipelines:

The queries get a Sql server connection and use ExecuteNonQueryAsync to run the SqlCommand.

Query #923 update set_list set song_id = 13 where dml_flag = 1 and gig_id < 13 failed unexpectedly with exception: System.AggregateException: One or more errors occurred. ---> Microsoft.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 Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Polaris.Test.Utilities.SqlServerUtils.<GetSqlServerFrontendConnectionAsync>d__11.MoveNext() in C:__w\1\s\test\TestUtilities\SqlServerUtils.cs:line 256
--- 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 Microsoft.Polaris.Utilities.SyncAwaiter.<>c__DisplayClass1_01.<<SyncAwaitThrow>b__0>d.MoveNext() in C:\__w\1\s\src\Utilities\SyncAwaiter.cs:line 0 --- 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 Microsoft.Polaris.Utilities.SyncAwaiter.SyncAwaitThrow[T](Func1 taskToAwaitOn) in C:__w\1\s\src\Utilities\SyncAwaiter.cs:line 44
at Microsoft.Polaris.Test.Utilities.SqlServerUtils.GetSqlServerFrontendConnection(String connectionDatabase, HashSet1 enableFeTraceFlags, HashSet1 disableFeTraceFlags) in C:__w\1\s\test\TestUtilities\SqlServerUtils.cs:line 276
at Microsoft.Polaris.Test.IntegrationTest.Utils.ResultRowSet.d__11.MoveNext() in C:__w\1\s\test\IntegrationTest\Utils\ResultRowSet.cs:line 0
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Polaris.Test.Utilities.SqlServerUtils.d__11.MoveNext() in C:__w\1\s\test\TestUtilities\SqlServerUtils.cs:line 256
--- 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 Microsoft.Polaris.Utilities.SyncAwaiter.<>c__DisplayClass1_01.<<SyncAwaitThrow>b__0>d.MoveNext() in C:\__w\1\s\src\Utilities\SyncAwaiter.cs:line 0 --- 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 Microsoft.Polaris.Utilities.SyncAwaiter.SyncAwaitThrow[T](Func1 taskToAwaitOn) in C:__w\1\s\src\Utilities\SyncAwaiter.cs:line 44
at Microsoft.Polaris.Test.Utilities.SqlServerUtils.GetSqlServerFrontendConnection(String connectionDatabase, HashSet1 enableFeTraceFlags, HashSet1 disableFeTraceFlags) in C:__w\1\s\test\TestUtilities\SqlServerUtils.cs:line 276
at Microsoft.Polaris.Test.IntegrationTest.Utils.ResultRowSet.d__11.MoveNext() in C:__w\1\s\test\IntegrationTest\Utils\ResultRowSet.cs:line 0
ClientConnectionId:c7a38229-4986-468a-b723-bd0e794291af
Error Number:-2,State:0,Class:11<---
System.AggregateException: One or more errors occurred. ---> Microsoft.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 Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Polaris.Test.Utilities.SqlServerUtils.d__11.MoveNext() in C:__w\1\s\test\TestUtilities\SqlServerUtils.cs:line 256
--- 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 Microsoft.Polaris.Utilities.SyncAwaiter.<>c__DisplayClass1_01.<<SyncAwaitThrow>b__0>d.MoveNext() in C:\__w\1\s\src\Utilities\SyncAwaiter.cs:line 0 --- 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 Microsoft.Polaris.Utilities.SyncAwaiter.SyncAwaitThrow[T](Func1 taskToAwaitOn) in C:__w\1\s\src\Utilities\SyncAwaiter.cs:line 44
at Microsoft.Polaris.Test.Utilities.SqlServerUtils.GetSqlServerFrontendConnection(String connectionDatabase, HashSet1 enableFeTraceFlags, HashSet1 disableFeTraceFlags) in C:__w\1\s\test\TestUtilities\SqlServerUtils.cs:line 276
at Microsoft.Polaris.Test.IntegrationTest.Utils.ResultRowSet.d__11.MoveNext() in C:__w\1\s\test\IntegrationTest\Utils\ResultRowSet.cs:line 0
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Polaris.Test.Utilities.SqlServerUtils.d__11.MoveNext() in C:__w\1\s\test\TestUtilities\SqlServerUtils.cs:line 256
--- 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 Microsoft.Polaris.Utilities.SyncAwaiter.<>c__DisplayClass1_01.<<SyncAwaitThrow>b__0>d.MoveNext() in C:\__w\1\s\src\Utilities\SyncAwaiter.cs:line 0 --- 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 Microsoft.Polaris.Utilities.SyncAwaiter.SyncAwaitThrow[T](Func1 taskToAwaitOn) in C:__w\1\s\src\Utilities\SyncAwaiter.cs:line 44
at Microsoft.Polaris.Test.Utilities.SqlServerUtils.GetSqlServerFrontendConnection(String connectionDatabase, HashSet1 enableFeTraceFlags, HashSet1 disableFeTraceFlags) in C:__w\1\s\test\TestUtilities\SqlServerUtils.cs:line 276
at Microsoft.Polaris.Test.IntegrationTest.Utils.ResultRowSet.d__11.MoveNext() in C:__w\1\s\test\IntegrationTest\Utils\ResultRowSet.cs:line 0
ClientConnectionId:c7a38229-4986-468a-b723-bd0e794291af
Error Number:-2,State:0,Class:11<---

Further technical details

Microsoft.Data.SqlClient version: 5.2.0

@DavoudEshtehari DavoudEshtehari added this to Needs triage in SqlClient Triage Board via automation Apr 25, 2024
@David-Engel
Copy link
Contributor

That is the expected error when the command takes longer than the timeout. Have you tried increasing your CommandTimeout?

@kf-gonzalez2 kf-gonzalez2 added ℹ️ Needs more Info Waiting on additional information and removed untriaged labels Apr 30, 2024
@kf-gonzalez2 kf-gonzalez2 moved this from Needs triage to Needs More Info in SqlClient Triage Board Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ℹ️ Needs more Info Waiting on additional information
Projects
SqlClient Triage Board
  
Needs More Info
Development

No branches or pull requests

4 participants