If the ProcessingEngineTasks database has the Default Cursor option set to GLOBAL, an SqlException may be thrown during the update of a task when the prerequisite task has failed.
The following exception can be found in the Sitecore XP log:
System.Data.SqlClient.SqlException : A cursor with the name 'DependentTasks' already exists. The cursor is already open. A cursor with the name 'DependentTasks' already exists. at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__174_0(Task`1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.Tasks.Task.Execute()
In the ProcessingEngineTasks database, modify the UpdateTaskStatusById stored procedure as follows:
Replace this line:
DECLARE [DependentTasks] CURSOR FOR
with this one:
DECLARE [DependentTasks] CURSOR LOCAL FOR