Workflow Task Lock issue !

Sometimes when the number of items in the list gets high ( say more than 1500 ) we might get to see the Tasks getting locked issue for some of the items. In the SharePoint UI, the exception is “This task is currently locked by a running workflow and cannot be edited”

The ULS logs will give some fair idea on the issue.

 

0x0BAC Windows SharePoint Services Workflow Infrastructure 936l High Engine RunWorkflow: System.Workflow.Activities.EventDeliveryFailedException: Event "OnTaskChanged" on interface type "Microsoft.SharePoint.Workflow.ITaskService" for instance id "b4077790-6160-4eea-8696-863238532f57" cannot be delivered. ---> System.ArgumentNullException: Buffer cannot be null. Parameter name: buffer at System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable) at Microsoft.SharePoint.Workflow.SPWinOePersistenceService.LoadWorkflowInstanceState(Guid instanceId) at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance)

This exception says that the workflow is not able to deliver the all the events at a given time and so the tasks get locked. OOB, the default event delivery throttle value is 15. The value can be increased using STSADM command

stsadm -o setproperty -pn workflow-eventdelivery-throttle -pv "50"

For more details on using the command : https://technet.microsoft.com/en-us/library/cc287939.aspx