-
-
Notifications
You must be signed in to change notification settings - Fork 689
Execution Call Graph to detect cyclic tasks #2280
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?
Conversation
Some testing of for loops. Works, but, if the call graph converges (e.g. task calls task with no vars, so hash is identical, which means identical vertex) then ErrEdgeAlreadyExists will occur. Possible solution:
Real question for consideration is if the call graph should really converge? Or if the call graph should be made unique? When the graph converges, call information is lost (e.g. profiling information or other tracking). Some of that would also depend on how the With run=always task calls would be this: but with convergence of the call graph you end up with: In some ways that is correct (for a graph) but not really correct for a call graph ... unless run=once when the second C should never be called ... another thing to check. Quite a few variations checked: Something similar needs to be done with sources, since it might be necessary to add them (sources) to the task call hash. |
The graph seems to work, and the theory behind it is becoming more robust. Also, worthwhile covering some of the previous reported cases: #820 And, I think it could be useful to be able to disable this with an envar, since ... sometimes people know what they are doing ... |
A prototype of an Execution Call Graph, can be used to detect cyclic task calls, and for profiling. It uses the same techniques as used for the Reader graph.
The initial implementation is using graph features to detect duplicate edges and cycles. Because of the way the graph hash is currently generated, it's also possible to use duplicate vertices as a detection method (but currently disabled). That might change, depending on how the call graph (and hash) are realised.
Some very simple test data exists, to prove the concept, and more would be needed to cover all possible call patterns. Quick experiment with these commands:
Next? more and more examples to check the graph algorithm, more thinking about the graph itself (if the idea/algo is correct), adding profiling data, a way to print the call graph (similar to the reader).