fission / fission-workflows

Workflows for Fission: Fast, reliable and lightweight function composition for serverless functions
Apache License 2.0
371 stars 42 forks source link

Infinite Recursion Detection #13

Open erwinvaneyk opened 7 years ago

erwinvaneyk commented 7 years ago

Given that a major emphasis is made on re-using workflows and recursion over iteration. It is vital for the workflow engine to have some sort of recursion detection.

Solution 1 A "parent" parameter could be added (as a header for example) that links a workflow to its parent workflow. From there the workflow engine can analyze the workflow dependency graph to determine whether a infinite recursion is occurring

Potential issues:

Solution 2 Add a stack parameter to the request, containing all preceding workflow invocation ids. The workflow engine can infer can simply call a stack overflow if the stack becomes to large.

Potential issues:

...

soamvasani commented 7 years ago

What about Solution 2, but with a count instead of the actual list?

erwinvaneyk commented 7 years ago

@soamvasani seems like a good trade-off indeed. Although in that case you the engine cannot provide feedback on where the (infinite) recursion/error actually took place/started. Not sure if that is a realistic use case though.