Rock
Rock copied to clipboard
Activating an activity in a currently running workflow may never get processed.
From @cabal95 on #2044:
If you try to activate an activity in a workflow that is currently being processed, the activity will (probably) never be activated. This happens because the in-memory Workflow object that is being processed runs until it has no more activities and then marks the workflow as completed. Since the changes only exist in the database and not in-memory it doesn't know about the new activity and thus marks itself as complete. For the moment I have caused an error to occur if trying to activate an activity in a workflow that is IsProcessing. Seeing this is easy by having the Lava try to activate a new activity in it's own Workflow (for example, say I want to loop through a bunch of personIds and trigger an activity for each of those personIds to do some work).
This seems to be a deeper issue because I believe the existing "Activate Activity in Another Workflow" has this issue too. I think it is just far more unlikely to run into that problem because, in general, I believe workflows only process single threaded. i.e. the Job runner is only single threaded (afaik).