workflow-core icon indicating copy to clipboard operation
workflow-core copied to clipboard

PersistedWorkflow ExecutionPointers exponentially increase in workflow loop.

Open jswolf1223 opened this issue 2 years ago • 3 comments

Describe the bug Workflows that loop over steps double the number of ExecutionPointers with each loop. This is causing exponential slowdown with each iteration. This seems to be stemming from the filter loop in the Execute method in the the WorkflowExecutor that filters out inactive pointers Execute method.

To Reproduce Create a workflow that loops over the same steps. With each successive iteration check the ExecutionPointers count and time it takes to complete the loop.

Expected behavior Looping behavior should not be increasing the execution time of a workflow

Additional context With only the active pointers being used, is it necessary to persist the inactive pointers? To alleviate the problem these changes were made to the EntityFrameworkPersistenceProvider in our forked repo. With these changes each iteration is being performed at a consistent time and no unintended effects have been observed (yet).

jswolf1223 avatar Apr 26 '22 18:04 jswolf1223

I also encountered this problem,My current solution is use a middleware to clean WorkflowExecutor. No impact on existing business after cleaning

tchivs avatar Jun 08 '22 02:06 tchivs

seems to e a duplicate of #1028

manuel-scharf-snkeos avatar Aug 31 '22 18:08 manuel-scharf-snkeos