locked
Workflow Sometimes Work and Sometimes not working RRS feed

  • Question

  • Hi,

    I have sharepoint designer 2010 workflow which has custom workflow activity (developed in Visual Studio 2010) for sharepoint 2010.

    It is working in dev and I moved it to production and it has some issue.

    sometimes workflow is not working. It's failed on start.

    But once it is failed on working and after that if I run the workflow, it is working successfully.

    And then after several hours (maybe 2-3 hours) , it's not working one time and after one fail, it is working successfully.

    I have custom page with some field and user should fill in the data. When user fill in the data and click the button then workflow is started.

    I use this code to start workflow :

    serverSite.WorkflowManager.StartWorkflow(curItem, wrkFl, wrkFl.AssociationData,

    true);

    The log I found is like the below:

    04/11/2012 00:10:51.12  w3wp.exe (0x2268)                        0x1468 SharePoint Foundation          Workflow Infrastructure        936l High     Engine RunWorkflow: System.Threading.ThreadAbortException: Thread was being aborted.     at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)     at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)     at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)     at System.Activator.CreateInstance(Type type, Boolean nonPublic)     at System.Workflow.Runtime.Hosting.DefaultWorkflowLoaderService.CreateInstance(Type workflowType)     at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType, Boolean createDefinition, Boolean initForRuntime)     at System.Workflo... d64be7a4-30f4-44d9-8179-793170d22c0e
    04/11/2012 00:10:51.12* w3wp.exe (0x2268)                        0x1468 SharePoint Foundation          Workflow Infrastructure        936l High     ...w.Runtime.WorkflowDefinitionDispenser.MruCache.GetOrGenerateDefinition(Type type, String xomlText, String rulesText, Byte[] md5Codes, Boolean initForRuntime, Boolean& exist)     at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime)     at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance)     at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance)     at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context)     at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext co... d64be7a4-30f4-44d9-8179-793170d22c0e
    04/11/2012 00:10:51.12* w3wp.exe (0x2268)                        0x1468 SharePoint Foundation          Workflow Infrastructure        936l High     ...ntext, Guid instanceId)     at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type workflowType, Dictionary`2 namedArgumentValues, Guid instanceId)     at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWorkflow workflow, SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e)     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut) d64be7a4-30f4-44d9-8179-793170d22c0e
    04/11/2012 00:10:51.13  w3wp.exe (0x2268)                        0x1468 SharePoint Foundation          Workflow Infrastructure        72fs Unexpected RunWorkflow: System.Threading.ThreadAbortException: Thread was being aborted.     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection`1 events, SPWorkflowRunOptionsInternal runOptions) d64be7a4-30f4-44d9-8179-793170d22c0e
    04/11/2012 00:10:51.51  w3wp.exe (0x2268)                        0x1468 SharePoint Foundation          Workflow Infrastructure        98d8 Unexpected System.Threading.ThreadAbortException: Thread was being aborted.     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection`1 events, SPWorkflowRunOptionsInternal runOptions) d64be7a4-30f4-44d9-8179-793170d22c0e
    04/11/2012 00:10:51.54  w3wp.exe (0x2268)                        0x1468 SharePoint Foundation          Workflow Infrastructure        72fq Unexpected Start Workflow: System.Threading.ThreadAbortException: Thread was being aborted.     at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection`1 events, SPWorkflowRunOptionsInternal runOptions)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.StartWorkflowElev(Object context, SPWorkflowAssociation association, DateTime elevationTimeUtc, SPWorkflowEvent startEvent, SPWorkflowRunOptions runOptions) d64be7a4-30f4-44d9-8179-793170d22c0e
    04/11/2012 00:10:51.58  w3wp.exe (0x2268)                        0x1468 SharePoint Foundation          Runtime                        tkau Unexpected System.Web.HttpException: Request timed out.  d64be7a4-30f4-44d9-8179-793170d22c0e

    If you have any idea, please advise me.

    thansk,

    Friday, April 13, 2012 7:47 PM

Answers

  • Hi developerCha,

    The ThreadAbortExceptions in the ULS log indicate that the working threads in w3wp had took too long time to execute the response code and they’re aborted by the IIS.

    1. You may change the connection timeout setting in IIS so that IIS will not abort the thread that is executing the workflow code. Please refer to this Document to set the connection timeout. If the problem is caused by heavy overload, this solution may solve the problem.
    2. You may also set the Log trace level to verbose to get more information about the exception. Please check this Link to set the log level.
    3. You should also check all correlation tokens, make sure that each task has its own Token. Please check this Document for more information.

    Hope that helps.

    Thanks,


    Lambda Zhao

    TechNet Community Support

    Tuesday, April 17, 2012 9:51 AM

All replies

  • Hi developerCha,

    The ThreadAbortExceptions in the ULS log indicate that the working threads in w3wp had took too long time to execute the response code and they’re aborted by the IIS.

    1. You may change the connection timeout setting in IIS so that IIS will not abort the thread that is executing the workflow code. Please refer to this Document to set the connection timeout. If the problem is caused by heavy overload, this solution may solve the problem.
    2. You may also set the Log trace level to verbose to get more information about the exception. Please check this Link to set the log level.
    3. You should also check all correlation tokens, make sure that each task has its own Token. Please check this Document for more information.

    Hope that helps.

    Thanks,


    Lambda Zhao

    TechNet Community Support

    Tuesday, April 17, 2012 9:51 AM
  • Lambda,

    Thanks for your reply.

    The first one (Extend Timeout) was one of my option. And I tried and I am not getting error.

    But, I am wondering why it takes so long to start workflow manually. When I checked it, it took roughly more than 2 minutes after iisreset or some cache flushing.

    If you know anything else about this, please let me know.

    thanks,

    Wednesday, April 18, 2012 4:53 PM