Search code examples
.netwcfworkflow-foundation-4workflowservice

What would cause a RedirectionException in a Windows Workflow Service?


What exactly could be the root cause of the Workflow Service Host throwing the following type of RedirectionException:

System.ServiceModel.Channels.RedirectionException: The requested resource has moved to the one of the following locations:
    http://blah.mydomain.com/MyWorkflowService.svc
    at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
    at System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.InvokeEnd(Object instance, Object[]& outputs, IAsyncResult result)
    at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc& rpc)
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc& rpc)
    at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

The documentation for RedirectionException is generic in terms of WCF and I get what it's for, but I'm not sure what condition is triggering the Workflow Service Host itself to throw it and there doesn't seem to be any documentation on it.


Solution

  • I don't think I have ever seen this happen but according to Reflector it is the result of an InstanceLockedException being thrown which happens when a WF instance cannot be locked. This could either be because another WorkflowServiceHost has locked and loaded it or because of some inconsistency in the instance store database.