Executing multiple flows in parallel in a process

Certified Senior Developer

What happens when two flows execute simultaneously in a Process Model (the second path gets kicked off by a Rule Event), and both try to update different fields in the same CDT at the potentially the same time? The order they execute in would be non-deterministic. Is it possible that the entire CDT may revert the changes from one of the paths when the other completes? We saw this happen in rare instances in the process history, and it appears to be the result of a race condition with these two writes. (Unfortunately, Process History doesn't go down to the millisecond, or even second, level of granularity, so it is hard to tell how close the calls actually were - just that they were within the same minute)....

OriginalPostID-87428

OriginalPostID-87428

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer
    To explain our work flow a bit more concretely: we have a large CDT that contains most of the data we use in our process flow. One field of the CDT is an array of boolean "event flags". One such flag is used to trigger exception flows on tasks, and after it gets tripped we need to reset the flag to false again so the tasks can be started once more. So we have a rule that listens for this flag, which goes to a script task that resets it. This runs simultaneously to a workflow that is updating a status indicator in another field in the same CDT.

    What we are seeing is that, in very rare cases that are difficult to reproduce, sometimes the history shows that the status field gets set - and then when the flag gets reset, the status field setting reverts back to what it was before it was set. Since these flows happen in parallel, it occurred to me that they could be simultaneous writes to the same CDT in a race condition (which is why it is a rare occurrence). Is this possible? Is it a defect? Or is it a behavior we need to be aware of and develop around?
Reply
  • 0
    Certified Senior Developer
    To explain our work flow a bit more concretely: we have a large CDT that contains most of the data we use in our process flow. One field of the CDT is an array of boolean "event flags". One such flag is used to trigger exception flows on tasks, and after it gets tripped we need to reset the flag to false again so the tasks can be started once more. So we have a rule that listens for this flag, which goes to a script task that resets it. This runs simultaneously to a workflow that is updating a status indicator in another field in the same CDT.

    What we are seeing is that, in very rare cases that are difficult to reproduce, sometimes the history shows that the status field gets set - and then when the flag gets reset, the status field setting reverts back to what it was before it was set. Since these flows happen in parallel, it occurred to me that they could be simultaneous writes to the same CDT in a race condition (which is why it is a rare occurrence). Is this possible? Is it a defect? Or is it a behavior we need to be aware of and develop around?
Children
No Data