Comments (15)
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.
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.
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.
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.
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.
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.
from workflow-core.
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.
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.
from workflow-core.
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.
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.
from workflow-core.
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.
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.
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.
from workflow-core.
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.
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)
- Can't use WorkflowTest when workflow constructor takes parameters
- Post workflow middleware can't catch cancelled workflow
- [Proposal] Add IServiceScope support so that steps can get same service instances from this scope HOT 1
- How to write Waitfor in JSON ? HOT 1
- Start workflow but it does not in run steps function
- Whether there is a way to use memory mode without memory leaks
- How can I define UserTask using JSON file? HOT 1
- Parallel tasks run in sequence not parallel HOT 2
- What should I do if it is rejected to the specified node that has been executed
- Why can'not I use constructor function in workflow step function HOT 1
- Multiple processes are multi-threaded in parallel? HOT 1
- Can I use the library to implement a fallback mechanism?
- How to achieve a better process rollback workflow HOT 4
- How to achieve exponential backoff retry policy HOT 1
- Facing issue to use Mongo as persistance storage HOT 2
- On wpf application workflow doesn't run at first HOT 3
- How to rollback service Transaction
- host.Start()启动后的host对象和从容器获取的IWorkflowHost对象不一样
- How to register workflows on every node with Multi-node clusters?
- Clear terminated workflow instances
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workflow-core.