WorldServer - after being canceled, Tasks/Jobs remain in 'To be canceled' status in the Workflow Engine Queue or in the Background Jobs
000008316|9/14/2021 9:45 PM
SDL WorldServer 11.1.1
Some Jobs/Tasks were canceled from the Workflow Engine Queue. Instead of simply disappearing from the Workflow Engine Queue and also instead of displaying as Canceled in the project's tasks page, those Tasks remain in status To Be Canceled.
In some cases, these tasks/jobs block other jobs from being processed and they remain "In queue":
If the issue happens in the Workflow Engine Queue:
1-If the To Be Canceled jobs are the same or higher priority, in the database, you can change the priority below the other tasks that need to execute.
select * from TASKS where PROJECTID = yyyyy
Find the task in the project in the UI that is in the To Be Canceled state
update TASKS set PRIORITY = 4 where TASKID = zzzzz
Restart the Workflow Engine Queue via ws_gate (if available). Follow the steps in this article:
Then change the status of the To Be Canceled jobs in the database to Canceled:
select TASKID, PROJECTID, PROJECTGROUPID, STATUS, COMPLETIONSTATUS, TASKAUTOSTEPSTATE, TASKNUMINPROJECT
from TASKS where PROJECTID=xxxxxx
Find the task in the project in the UI that is in the To Be Canceled state and update that taskid's taskautostepstate=0
update TASKS set TASKAUTOSTEPSTATE = 0 where TASKID = YYYYYY
However, this does not always work.
2- If #1 doesn't work, to remove those Jobs from the Workflow Engine queue and move them to canceled status, an Idiom restart needs to be done. After Idiom restart, the To Be Canceled status will disappear, the jobs/tasks will not be visible in the Workflow Engine Queue anymore and those tasks will have the status Canceled in the Tasks page as expected.
3- If steps #1 and #2 remain unsuccessful and those jobs in To Be Canceled status do not go away after Idiom restart, the only way is to remove them from the Database as explained in this article
where a Job remains in To Be Canceled and does not complete, use the Job ID corresponding to the Job and run this query in the Database to send the job to status On Hold (STATUS=3). The BACKGROUNDTASKID corresponds to the Job ID column.
update BACKGROUNDTASKS set STATUS=3 where BACKGROUNDTASKID=6718115
Once the query as been run, refresh the Background Jobs page: that Job will now be in status On Hold. Resume it and the cancellation will be completed. Unfortunately it is not possible to change the status of a To Be Canceled jobs from the UI, which is why we do this in the Database.