Giter VIP home page Giter VIP logo

Comments (15)

danielgerlag avatar danielgerlag commented on July 1, 2024

Hi Aaron,

When you call .PublishEvent on the WorkflowHost, it does add the event to the process queue for immediate execution. The RunnablePoller runs by default every 10 seconds (this value can be configured), to pick up any future dated events that have expired. Are you seeing some kind of delay on your side?

from workflow-core.

aaronchambers avatar aaronchambers commented on July 1, 2024

Hi Daniel,

Yes that is correct and is what I am seeing. I was thinking of something that allows the poller to remain at 10 seconds (For the sleep state steps I have), and being able to process the event immediately without waiting 10 seconds. I am using a SQL azure setup so was concerned that taking that poller down to 1 second would create too much unnecessary traffic. What are your thoughts?

from workflow-core.

danielgerlag avatar danielgerlag commented on July 1, 2024

Oh I see... I could look into a solution where the poller reads ahead for workflows that will be ready to run between now and the next poll and delay queue them according to their next scheduled execution time?

from workflow-core.

aaronchambers avatar aaronchambers commented on July 1, 2024

Sounds good, I haven't looked into the queue code closely, but if that allows an event to be processed immediately that already has a matching subscription registered that would be great. Thanks.

from workflow-core.

danielgerlag avatar danielgerlag commented on July 1, 2024

Cool, I will explore that and some other approaches... would you be willing to share your workflow code, so I can better understand your problem context?

from workflow-core.

aaronchambers avatar aaronchambers commented on July 1, 2024

Hi Daniel,

Sure, I have attached the Workflow, basically the workflow is mostly waiting for an event to occur at each level. Because I have the workflow tied to a Status grid UI, it would be helpful to be able to process these events immediately which then updates the UI Grid. I am not sure if you intended the events to be used this way but it works well.

ApprovalWorkflow.zip

from workflow-core.

danielgerlag avatar danielgerlag commented on July 1, 2024

I have released a new version with some improvements in this area... please test it and let me know if it solves your issue.

from workflow-core.

aaronchambers avatar aaronchambers commented on July 1, 2024

Hi Daniel,

I have tested the latest version and confirm that events are being processed immediately now. Thanks for that update.

I have noticed that occasional errors occur on the WorkflowExecutor after an event is publish (and subsequently processed). In the previous version I was using from June 1st, on occasion a workflowexecutor error would occur on my first "WaitFor" event. If that occured that workflow instance would never be able to complete. The detailed error would say that the data object passed in when creating the workflow instance was null, on review of the Workflow table the "Data" column always contained the correct serialised object.

The WorkflowExecutor would log something similar to below

Workflow 8e1c4f2d-b9ad-4f49-96c6-75cb7cffb12f raised error on step 1 Message: Exception has been thrown by the target of an invocation. InnerException: System.NullReferenceException: Object reference not set to an instance of an object.
at lambda_method(Closure , POData ) Data: System.Collections.ListDictionaryInternal

In your current commit I have noticed that the WorkflowExecutor error still occurs but that it still allows the workflow to continue (which is preferred to stopping the workflow). Is there anything I should be looking at to prevent this from happening. I have attached a recent log with the Error.

Thanks for your help.

Workflow_log.xlsx

from workflow-core.

danielgerlag avatar danielgerlag commented on July 1, 2024

Hi Aaron,

I'm really concerned over this error... are you able to share all the code required to reproduce this? (we can share it privately too). Also, did you perhaps make changes to the workflow after some instances were persisted without incrementing the version number?

from workflow-core.

aaronchambers avatar aaronchambers commented on July 1, 2024

Hi Daniel,

I have attached a sample which reproduces this error. I haven't changed the version number of the workflow.

I have created a test workflow and added to the default MVC project. As you will notice the WorkflowExecutor records an error after each event is published. If you click the "Create" button on the Index page it will create a Purchase Order and then publish 2 approval events.

The initial version that I was using only displayed this error occasionally (perhaps 1% of the time). It would keeping trying to execute each time and fail again with the same error.

This version seems to record an error after each published event but allow the workflow to continue to completion.

Hope this helps.

TestWorkflowCore.zip

from workflow-core.

danielgerlag avatar danielgerlag commented on July 1, 2024

Hi Aaron,

I have released 1.3.1 which should address this issue, also I noticed that you were double registering the services with 2 .AddWorkflow() calls... I have added a check that will only allow it to be done once on a service collection... In your case, just remove the first one with the built-in memory provider and keep the one with the SQL Server provider.
Also maybe check out this package
https://github.com/danielgerlag/workflow-core/tree/master/src/extensions/WorkflowCore.Users
It looks like you are doing something similar?

from workflow-core.

aaronchambers avatar aaronchambers commented on July 1, 2024

Hi Daniel,

Thanks for the update, it has resolved the issue. I completely missed that I was registering the service twice, thanks for the pointing that out.
Yes the Users package is similar to what I am doing, I will check that out.

from workflow-core.

aaronchambers avatar aaronchambers commented on July 1, 2024

Hi Daniel,

I thought this issue was resolved but it is still occurring at random times with similar frequency as before (approx 1% of workflows). I have attached the log messages along with the Workflow, ExecutionPointer, ExecutionError data. The Workflow I am using is the same as the project above.

I have tried to replicate in a local version running through 1000+ workflows without being able to force the error. It is possible this only occurs when deployed to an Azure app though can't confirm. The error always appears to occur on the same initial steps. If the workflow gets through these first steps it always completes properly. I am using Resilient SQL Connections. If you need anything else please let me know. Thanks.

Workflow_Log.xlsx

from workflow-core.

danielgerlag avatar danielgerlag commented on July 1, 2024

Hi Aaron,

Unfortunately, there is not enough info there to see the problem. Are you running multiple worker roles in Azure? Could you try set the log level to debug?

from workflow-core.

aaronchambers avatar aaronchambers commented on July 1, 2024

Hi Daniel,

Further testing has revealed there was an unhandled exception in one of the steps and is now resolved. Thanks for your input.

from workflow-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.