-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Added null checks to ActionFactory #6803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Added null checks to ActionFactory #6803
Conversation
|
When create Elsa.Workflows.Activities.NotFoundActivity in Elsa.Workflows.Serialization.Converters.ActivityJsonConverter the activityRegistry.Find() looks like it cannot find the ActivityDescriptor yielding these nullref exceptions |
|
I'm wondering if handling these null values isn't going to hide the underlying problem of why the descriptor was null in the first place. |
|
yes your right, I will add an exception in ActivityJsonConverter when I think we found how to reproduce this issue. Since ActivityRegistry is a singleton and RegisterAsync is only called when dealing with workflow graphs/builder. So when a workflow is started and the host process is restarted the registry is empty. resuming the workflow or quering the workflowdefinition will result in these exceptions. We frequently getting these issues after the container running the workflow-engine was restarted. |
Throw aexception when NotFoundActivity cannot be found. rare case but it could occure
Added test case to reproduce the issue
|
@sfmskywalker I've added a test to get this issue. MaterializeWorkflowPriorToPopulateRegistriesAsync |
First initialize using TypedActivityDescriptor
|
i think, i understand as to why this can happen.
So i changes the first step in PopulateRegistryAsync to populate TypedActivities only. In this case the NotFoundActivity is always available. then populate the workflowdefinitionstore and continue as it was. |
|
@sfmskywalker do you think this is oke? (We tested it by replacing the activityRegistryPopulator and it seems to work) |
4e58970 to
ae1bb77
Compare
This change is