locked
Async Callback exception with WorkflowServiceHost RRS feed

  • Question

  • I have a self hosted WorkflowServiceHost (A) with a simple workflow and SqlWorkflowInstanceStore configured. The workflow just starts and goes idle (Delay activity inside Pick) after the timeout hit the wf instance is resumed and completed. Everything is working fine if i have only this service host.
    When i create a second WorkflowServiceHost (B) with a different workflow the situation is the following:

    WF ServiceHost A creates instance and goes idle, after the timeout i got the exception:
    {"Async Callback threw an exception."}
    Source: System.Runtime.DurableInstancing

    So it is not able to load the wf instance from the persistance database any more. The strange thing is that the exception message referencing to
    WF servicehost B, say it has wrong activities, i feel it somehow mixing things.

    I have a new SqlWorkflowInstanceStore for each WorkflowServiceHost.

    Any idea would helpful or What is the recommended way to have more durable WorkflowServiceHosts? 

    Thursday, March 10, 2011 5:36 PM

All replies

  • Hi,

    ->"WF ServiceHost A creates instance and goes idle, after the timeout i got the exception:"
    Could you paste the full exception stake message.

    Thanks
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Tuesday, March 15, 2011 3:20 AM
  • Hi,

    Sometimes i get this behaviour when i start 2 workflows in serviceHost A, of course there is no problem when serviceHost B is not present.

    The strange is the InnerException, SyslogWrite is a custom activity for logfile write and is contained in ServiceHost B.
    I try to reproduce this issue with a sample project.

    From Visual Studio Development Server:

     

    Exception   

       Type: System.Runtime.CallbackException

     

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Data.Common.DbAsyncResult.AsyncCallback_Context(Object state)

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

       at System.Data.Common.DbAsyncResult.ExecuteCallback(Object asyncResult)

       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)

       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()

       at System.Threading.ThreadPoolWorkQueue.Dispatch()

       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

     

    InnerException

       Type: System.Activities.ValidationException

     

       'SyslogWrite' is not of type 'Sequence'. When loading this instance you must ensure that the activity with name 'SyslogWrite' implements 'Sequence'.

     

       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

       at System.ServiceModel.Activities.Dispatcher.DurableInstanceManager.WaitAndHandleStoreEventsCallback(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

     

    Wednesday, March 16, 2011 10:54 AM
  • Hi,

    ->" 'SyslogWrite' is not of type 'Sequence'. When loading this instance you must ensure that the activity with name 'SyslogWrite' implements 'Sequence'."

    One possible cause of the error is that the workflow definition is changed while it is running/persisted. so, when you are testing workflow services, please first delete all persisted workflow instance in the Sql Database. usually, I use Sql Procudure "DeleteInstance" to delete persisted workflow instances.

    Hope it helps
    Regards


    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Thursday, March 17, 2011 2:35 AM
  • Hi,

    I clean instance tables, and start with empty persistence DB.

    Friday, March 18, 2011 6:11 PM
  • Andrew, was this issue ever resolved? I have exactly the same conditions. I make sure the persistence db is cleared before starting the test. I have two very simple workflows (using WorkflowServiceHost as indicated above). I can run several copies of workflow A (which simply writes to log file and then waits 2 minutes before repeating) without any problems. I have another workflow (B) which will run only once a day (again using delay activity but calculating offset timespan and repeats). When I start workflow B the next time that a workflow A is started from persistence I get the same exception as detailed by xeondev. By the way, I can run workflow B by itself without any problems. Can you provide any suggestions? Thanks in advance for your reply.

    Al

    Monday, March 24, 2014 6:00 PM