Sitefinity 7.3 scheduled tasks giving lot of dead lock exception
Hi Team,
I have set up a scheduled task job and in the logs I see that lot of dead lock exceptions like below are occurring. However, the tasks seem to be executing fine. Any thoughts on this?
Message: Scheduler : ExecuteAllTasks , Exception Message Telerik.OpenAccess.RT.sql.SQLException: Transaction (Process ID 51) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. ---> System.Data.SqlClient.SqlException: Transaction (Process ID 51) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
at System.Data.SqlClient.SqlDataReader.Read()
at OpenAccessRuntime.Intellitrace.Read(DbDataReader reader, String id)
at Telerik.OpenAccess.Runtime.Logging.LoggingDbDataReader.Read()
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ResultSetImp.next()
--- End of inner exception stack trace ---
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ResultSetImp.next()
at OpenAccessRuntime.Relational.fetch.FetchResultImp.hasNext() : StackTrace : at OpenAccessRuntime.ExceptionWrapper.Throw()
at OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount)
at OpenAccessRuntime.DataObjects.ForwardQueryResult.Initialize()
at OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam)
at OpenAccessRuntime.ListEnumerator.setCurrent(Int32 _pos)
at OpenAccessRuntime.ListEnumerator.Move(Int32 relative)
at Telerik.OpenAccess.Query.TypedEnumerator`1.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at Telerik.Sitefinity.Scheduling.SchedulingManager.GetTasksFromAllProviders(Expression`1 whereFilter, String transactionName)
at Telerik.Sitefinity.Scheduling.Scheduler.InternalTimerElapsed(Object[] parameters)
Hello Praneeth,
It is really hard to say what is the exact reason for the issue you are experiencing. Can you please let me know more details about the scheduled task you are running? It is possible that during the execution of the scheduled task you are also trying to edit the items for example in the backend which will lock the items.
In addition to this, can you please delete the files under the ~/App_Data/Sitefinity/Logs folder (or copy the files to another location for backup) and then try to execute the scheduled task and let me know if there are any errors logged in the Logs folder. This way we can see if the issue reproduces every time a scheduled task is executed.
Please make sure that you do not edit any content in the backend and that there no items locked when executing the scheduled task.