Je cours des workflows dans worflow foundation 4 avec l'instanciation SQL Durable pour la persistance.InstanceOwnerException intermittent avec WF4
Parfois, j'obtiens System.Runtime.DurableInstancing.InstanceOwnerException lors de la reprise d'un 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 InstanceHandles. 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)
Existe-t-il un moyen d'éviter cette exception?
Vous avez raison, c'est arrivé pendant le débogage. Si je comprends bien, l'instance de flux de travail persistante a été verrouillée par une exécution précédente qui n'a pas libéré le verrou correctement. Je peux limiter ce problème en réduisant HostLockRenewalPeriod de sorte que le verrou expire plus rapidement, mais le moteur de flux de travail actualise son verrou plus souvent, ce qui entraîne une charge supplémentaire sur la base de données. – olorin
Je pensais juste vérifier, mais vous pouvez dire si le verrou d'origine a expiré par le 'SurrogateLockOwnerId' étant nul (en utilisant' SqlWorkflowInstanceStore'), ou y a-t-il d'autres choses à vérifier? – JasonRShaver