Clienttaskinstancerequests has invalid data

book

Article ID: 158321

calendar_today

Updated On:

Products

Task Server

Issue/Introduction

Clienttaskinstancerequests has invalid data

There is no specific error for this issue. Sometimes this error will manfist itself as "Task being put to sleep" until the task times out.

This may also manifest itself by the atrshost taking up a lot of memory when no tasks are being exectued in the environment.

Cause

Data in this table may become invalid because clients do not respond properly or in a timely manner. Tasks become backed up and the task engine fails to process new task instances properly.

Resolution

This table contains temporary data. When tasks/jobs are actively running in the environment they are tracked. When the task has finished executing it should be removed from this table.

The quick fix for this issue is to stop the atrshost and dataloader services then truncate the table and run a cleanup with the following SQL command:

truncate table clienttaskinstancerequests
exec tmCleanupSummaryOrphans
exec tmCleanupTaskOrphans

Restart the services after running that command.

We highly recommend that you diagnose the issue before you truncate the table. If you fail to diagnose the issue then it is likely that this problem will return.

Often times when this table is back logged from too much data it is cased by a task or policy executing more often than it should. Use the following query to identify what tasks are in the clienttaskinstancerequests table. Find the tasks executed most often and see if they can be optimized.

select i.name, count(*) as count from clienttaskinstancerequests ctir
join taskinstances ti
on ctir.taskinstanceguid = ti.taskinstanceguid
join itemversions iv
on ti.taskversionguid = iv.versionguid
join item i
on iv.itemguid = i.guid
group by i.name
order by count DESC

Another possible issue is that there are expired task instances in the clienttaskinstance requests table. Check to see if any tasks come up in the following query, if there are then they either need to be deleted or the clienttaskinstance table truncated:

Select *
from clienttaskinstancerequests ctir
left join taskinstances ti
on ctir.taskinstanceguid = ti.taskinstanceguid
where ti.taskinstanceguid is NULL