Intermittent InstanceOwnerException with WF4
I'm running workflows in worflow foundation 4 with SQL Durable instancing for persistence.
Sometimes, I'm getting System.Runtime.DurableInstancing.InstanceOwnerException when resuming a workflow.
System.Runtime.DurableInstancing.InstanceOwnerException occurred
Message="The execution of an InstancePersistenceCommand was interrupted because the instance owner registration for owner ID 'd2db07fd-f31d-458c-be53-de163d5db8d4' has become invalid. This error indicates that the in-memory copy of all instances locked by this owner have become stale and should be discarded, along with the In开发者_Python百科stanceHandles. Typically, this error is best handled by restarting the host."
Source=System.Runtime.DurableInstancing
StackTrace:
à System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
à System.Runtime.DurableInstancing.InstancePersistenceContext.ExecuteAsyncResult.End(IAsyncResult result)
à System.Runtime.DurableInstancing.InstancePersistenceContext.OuterExecute(InstanceHandle initialInstanceHandle, InstancePersistenceCommand command, Transaction transaction, TimeSpan timeout)
à System.Runtime.DurableInstancing.InstanceStore.Execute(InstanceHandle handle, InstancePersistenceCommand command, TimeSpan timeout)
à System.Activities.WorkflowApplication.PersistenceManager.Load(TimeSpan timeout)
à System.Activities.WorkflowApplication.LoadCore(TimeSpan timeout, Boolean loadAny)
à System.Activities.WorkflowApplication.Load(Guid instanceId, TimeSpan timeout)
à System.Activities.WorkflowApplication.Load(Guid instanceId)
Is there a way to avoid this exception?
This is usually the result of a previous run not completing normally and being restarted before the original lock expires. Is this happening as the result of a edit/debug/edit cycle or in a production environment?
You can adjust the lock period using the HostLockRenewalPeriod setting. Keep in mind that setting it to a real low value is normally not a good idea.
精彩评论