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

[BUG] Sporadic timeouts in SqlServerChangeTrackingSource #117

Open
s-vitaliy opened this issue Oct 11, 2024 · 1 comment · Fixed by #118
Open

[BUG] Sporadic timeouts in SqlServerChangeTrackingSource #117

s-vitaliy opened this issue Oct 11, 2024 · 1 comment · Fixed by #118
Assignees
Labels
code/bug Something isn't working

Comments

@s-vitaliy
Copy link
Contributor

Description

Sometimes SqlServerChangeTrackingSource fails with timeout on transaction commit when data extracted from SQL server and emited.
See stack trace below:

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 (258): Unknown error 258
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ThrowExceptionAndWarning(Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
   at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
   at Microsoft.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at Microsoft.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte[] buffer, TransactionManagerRequestType request, String transactionName, TransactionManagerIsolationLevel isoLevel, Int32 timeout, SqlInternalTransaction transaction, TdsParserStateObject stateObj, Boolean isDelegateControlRequest)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction2005(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
   at Microsoft.Data.SqlClient.SqlInternalTransaction.Commit()
   at Microsoft.Data.SqlClient.SqlTransaction.Commit()
   at Arcane.Framework.Sources.SqlServer.SqlServerChangeTrackingSource.SourceLogic.OnRecordReceived(Task`1 readTask)
   at Akka.Streams.Stage.GraphStageLogic.<>c__DisplayClass94_0`1.<GetAsyncCallback>b__1(Object x)
   at Akka.Streams.Implementation.Fusing.GraphInterpreter.RunAsyncInput(GraphStageLogic logic, Object evt, Action`1 handler)
--- End of stack trace from previous location ---
   at Arcane.Framework.Providers.Hosting.HostBuilderExtensions.RunStream[TContext](IHost host, ILogger logger, Func`3 handleUnknownException)
ClientConnectionId:418abcab-86e2-48e9-a229-48541d5ca28b
Error Number:-2,State:0,Class:11

Steps to reproduce the issue

  1. Start a streaming job targeting a MS SQL Server table.
  2. Wait couple of days
  3. Pod running a stream runner fails

Describe the results you expected

Stable SQL Server streams.

System information

all versions of Arcane.Framework

@s-vitaliy s-vitaliy added the code/bug Something isn't working label Oct 11, 2024
@s-vitaliy s-vitaliy self-assigned this Oct 11, 2024
@s-vitaliy s-vitaliy added this to Arcane Oct 11, 2024
@github-project-automation github-project-automation bot moved this to Done in Arcane Oct 14, 2024
@s-vitaliy s-vitaliy reopened this Oct 14, 2024
@s-vitaliy s-vitaliy moved this from Done to In progress in Arcane Oct 14, 2024
s-vitaliy added a commit that referenced this issue Oct 14, 2024
Implemented:
- Add the command timeout in GetChangeTrackingVersion property
s-vitaliy added a commit that referenced this issue Oct 14, 2024
Implemented:
- Add the command timeout in GetChangeTrackingVersion property
s-vitaliy added a commit that referenced this issue Oct 17, 2024
Call `Dispose()` method on SQL command to avoid resouce leaks.

Try approach from the following comment: dotnet/SqlClient#647 (comment)

Part of #117
@s-vitaliy
Copy link
Contributor Author

s-vitaliy commented Oct 17, 2024

s-vitaliy added a commit that referenced this issue Oct 17, 2024
Call `Dispose()` method on SQL command to avoid resouce leaks.

Try approach from the following comment: dotnet/SqlClient#647 (comment)

Part of #117
s-vitaliy added a commit to SneaksAndData/arcane-stream-sqlserver-change-tracking that referenced this issue Oct 17, 2024
s-vitaliy added a commit to SneaksAndData/arcane-stream-sqlserver-change-tracking that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/bug Something isn't working
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

1 participant