johanclasson / vso-agent-tasks

Build and Release Tasks for Visual Studio Online and Team Foundation Server
MIT License
20 stars 16 forks source link

DbUp Migration - Timeout not being respected #8

Closed null-reference closed 7 years ago

null-reference commented 7 years ago

I'm encountering timeouts during longer running scripts even though I have set the Timeout (Control Options -> Timeout) to 0 which indicates an infinite timeout.

Is this Timeout field expected to work?

image

Here is an example error from the logs...

_##[error]System.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 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync() at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket() at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer() at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DbUp.Support.SqlServer.SqlScriptExecutor.<>c__DisplayClass15_0.b_1(Func1 dbCommandFactory) in C:\projects\dbup\src\DbUp\Support\SqlServer\SqlScriptExecutor.cs:line 125 at DbUp.Engine.Transactions.NoTransactionStrategy.Execute(Action1 action) in C:\projects\dbup\src\DbUp\Engine\Transactions\NoTransactionStrategy.cs:line 14 at DbUp.Engine.Transactions.DatabaseConnectionManager.ExecuteCommandsWithManagedConnection(Action1 action) in C:\projects\dbup\src\DbUp\Engine\Transactions\DatabaseConnectionManager.cs:line 100 at DbUp.Support.SqlServer.SqlScriptExecutor.Execute(SqlScript script, IDictionary2 variables) in C:\projects\dbup\src\DbUp\Support\SqlServer\SqlScriptExecutor.cs:line 106

johanclasson commented 7 years ago

I have published a new version of the DbUp Migration task (0.10.5) which should remove the timeout issue. Hope it works for you @null-reference!

null-reference commented 7 years ago

Thank you very much @johanclasson! It's working! Our team is very appreciative.