locked
WF 3.5 does not respond to event RRS feed

  • Question

  •  

    We are running into a very strange problem with WF 3.5 -

    • We have a state machine based workflow which works well 9/10 times.
    • However, in some instances, we are unable to make certain workflow instances transition from one state to the next.
    • When an appropriate event is raised, the workflow instance does not respond. Our application which raises the events just sits there waiting for the workflow to finish processing and for the control to come back, but it never does.
    • This happens for some workflow instances only - not all of them.

     

    We have tried enabling workflow tracing and see the following in the log file:

    System.Workflow.Runtime Stop: 0 : Workflow Trace
    System.Workflow.Runtime.Hosting Information: 0 : WorkflowRuntime: Started WorkflowRuntime c4e27b53-12f3-4f83-a6d8-5dbcd2076c8b
    System.Workflow.Runtime.Hosting Information: 0 : SqlWorkflowPersistenceService OpenConnection start: 04/12/2010 18:51:43
    System.Workflow.Runtime.Hosting Information: 0 : SqlWorkflowPersistenceService. OpenConnection end: 04/12/2010 18:51:43
    System.Workflow.Runtime.Hosting Information: 0 : SqlWorkflowPersistenceService(00000000-0000-0000-0000-000000000000):Loading instance 9453fba4-964c-4aca-91d9-1b1d4c52fe1b
    System.Workflow.Runtime.Hosting Information: 0 : SqlWorkflowPersistenceService(00000000-0000-0000-0000-000000000000): retreiving instance: 9453fba4-964c-4aca-91d9-1b1d4c52fe1b, database: prd_wfEPM
    System.Workflow.Runtime.Hosting Information: 0 : SqlWorkflowPersistenceService.RetrieveStateFromDB 9453fba4-964c-4aca-91d9-1b1d4c52fe1b ExecuteReader start: 04/12/2010 18:51:43
    System.Workflow.Runtime.Hosting Information: 0 : SqlWorkflowPersistenceService.RetrieveStateFromDB 9453fba4-964c-4aca-91d9-1b1d4c52fe1b ExecuteReader end: 04/12/2010 18:51:43
    System.Workflow.Runtime.Hosting Information: 0 : Deserialized a CommPlanWorkflow [EPMWorkflowLibrary.CommPlanWorkflow] to length 89291. Took 00:00:00.2187500.
    System.Workflow.Runtime Information: 0 : Workflow Runtime: WorkflowExecutor: Loading instance 9453fba4-964c-4aca-91d9-1b1d4c52fe1b
    System.Workflow.Runtime Information: 0 : Adding context 1:CommPlanWorkflow for load
    System.Workflow.Runtime Information: 0 : Adding context 4:ApplicationSubmitted for load
    System.Workflow.Runtime Information: 0 : Adding context 5:PlansNotApproved for load
    System.Workflow.Runtime Information: 0 : Adding context 27:PlanReviewStart for load
    System.Workflow.Runtime Information: 0 : Adding context 28:OnAssessmentCycleCreated for load
    System.Workflow.Runtime.Hosting Information: 0 : WorkflowRuntime:: replacing unusable executor for key 9453fba4-964c-4aca-91d9-1b1d4c52fe1b with new one (hc: 7004053)
    System.Workflow.Runtime.Hosting Information: 0 : TimerEventSubscriptionQueue: 9453fba4-964c-4aca-91d9-1b1d4c52fe1b Resume
    System.Workflow.Runtime.Hosting Information: 0 : ManualWorkflowSchedulerService: Schedule workflow 9453fba4-964c-4aca-91d9-1b1d4c52fe1b
    System.Workflow.Runtime.Hosting Information: 0 : WorkflowRuntime:ScheduleLoaded event raised for instance Id 9453fba4-964c-4aca-91d9-1b1d4c52fe1b
    System.Workflow.Activities Information: 0 : Firing event AssessmentCycleApproved for instance 9453fba4-964c-4aca-91d9-1b1d4c52fe1b
    System.Workflow.Runtime Transfer: 0 : , relatedActivityId=9453fba4-964c-4aca-91d9-1b1d4c52fe1b

     

    • Here "9453fba4-964c-4aca-91d9-1b1d4c52fe1b" is the GUID.
    • The current state of the workflow instance is "PlanReviewStart"
    • The event being raised is "AssessmentCycleApproved"

    We have done extensive searches on google and in this forum but are unable to determine how to troubleshoot this problem. Any help will be much appreciated.

     

    Thanks.

    Monday, April 12, 2010 7:31 PM

All replies

  • Hi,

    ->"We have a state machine based workflow which works well 9/10 times. "

    Is it always works will 9/10 times? or sometimes, works well in 8/9 times?

    Have you tried using Tracking Service, or custom a tracking service and add some user data to track every state of activities.

    If the workflow isn't that complicated, you can also try debug it.

    Regards


    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    Sunday, April 18, 2010 8:21 AM
    Moderator
  • Hi Andrew,

    It is not predictable / consistent. In other words, it does not _always_ work 9/10 times. I wrote that to convey that it works well sometimes, and then suddenly, it does not.

    As you suggested, we will try using the Tracking Service next. The problem, however, is that this application is already in production. And there have been enough of these instances already where we simply cannot perform any action on an instance. We raise an event and as soon as the event is raised, the thread hangs.

    Thanks for your help.

    -Nandan

    Monday, April 19, 2010 6:47 PM
  • Hi,Nandan

    You should tune your application in a test environment, rather than in production environment. You can just copy the persisted data to the test box and run it. find the root cause of the problem and then fix it in production box.

    Regards


    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    Tuesday, April 20, 2010 1:57 AM
    Moderator
  • Hi Andrew,

    As you suggested, I did the following:

    1. Ran the scripts to setup the Tracking schema and logic in our test database.

    2. Configured the Workflow Runtime to use the Tracking service.

    3. Tried raising an event on the problem workflow instance.

    Here is the issue I am running into:

    a. The thread hangs as soon as the event is raised. So the workflow runtime does not even get a chance to run. Thus, there is no information in the tracking tables / views.

    b. We are unable to make a good instance become bad in the test environment. It has happened and is happening in the production environment. So we only become aware of workflow instances that have gone "bad" after they actually reach that faulty state. In other words, there isn't a set of steps we can follow to predictably generate a "bad" workflow instance.

    Could this be a environment issue (we are running this on Windows Server 2003)?

    Thanks,

    Nandan

    Tuesday, April 20, 2010 10:35 PM
  • Anyone? Any help we can get with this issue will be much appreciated.
    Tuesday, April 27, 2010 5:18 PM
  • Hi, Nandan

    ->"Could this be a environment issue (we are running this on Windows Server 2003)?"

    Windows Server 2003 can't be the root cause of the problem.

    ->"a. The thread hangs as soon as the event is raised. So the workflow runtime does not even get a chance to run"

    The problems seems not due to WF3,but some part of the code may go to a dead lock when the event get raised.

    ->"b. We are unable to make a good instance become bad in the test environment. It has happened and is happening in the production environment. So we only become aware of workflow instances that have gone "bad" after they actually reach that faulty state. In other words, there isn't a set of steps we can follow to predictably generate a "bad" workflow instance."

    IF you have a test environment, you can debug it in Visual Studio. VS would tell you which part of your code goes wrong. While in production environment, you may need to collect the dump file and look into the dump file to find the cause of the problem.

    IF you want to know more about dump file and debug, You would like to check this blog:

    http://blogs.msdn.com/tess/archive/2008/02/04/net-debugging-demos-lab-1-hang.aspx

    Regards


    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    Tuesday, April 27, 2010 11:53 PM
    Moderator
  • Hi Andrew,

    Thanks for your response.

    -> "IF you have a test environment, you can debug it in Visual Studio."

    I setup our test environment to mirror production and ran the application in debug mode. VS.NET also hangs as soon as the event is raised, and does not give me any more information about what the problem is.

    This is how the code looks:

     

    Public Function RaiseAssessmentCycleCreatedEvent(ByVal hProject As Project) As Boolean
    
        Dim eventResult As Boolean = True
    
        Try
    
          Dim e As CommPlanEventArgs = New CommPlanEventArgs(hProject.WF_Instance_Id, hProject)
    
          RaiseEvent AssessmentCycleCreated(Nothing, e)
    
        Catch ex As EventDeliveryFailedException
    
          HandleEventDeliveryFailedException(ex, eventResult)
    
        End Try
    
        RunWorkFlow(eventResult, hProject)
    
        Return eventResult
    
      End Function

     

    The debugger hangs as soon as I step into or over the "RaiseEvent AssessmentCycleCreated(Nothing, e)" line.

    Please note, as I mentioned in my previous posts, this happens for certain workflow instances only. It does not happen for every workflow instance. We don't know what causes workflow instances to behave like this.

    Thanks,

    Nandan

     

     

    Friday, April 30, 2010 6:41 PM
  • Nadan:

    Did you solve it? I'm having the same problem.

    Pablo

     

    Thursday, September 16, 2010 9:57 AM
  • Hi Nandan,

    did you solve this problem?

    Kind regards
    Sven

    Wednesday, October 31, 2012 11:00 AM