2018-05-04 12-26-50
Gonçalo Veiga
Detect possible infinite loops in action flows and force the definition of max iterations
2475
Views
13
Comments
On our RadarOn our Radar
Service Studio
As you all know infinite loops are great ways to slow down or even cause a non-responsive server.
Service Studio would detect circular flows (not with For Each) and force the user to define the max iterations allowed. If reached, it would trigger an exception.
user-made-loop detection
Well... detection of infinite loops is not attempted by any programming language. And for a good reason - it's an undecidable problem in computation theory. This means that it's an impossible task for any given computer.
2014-02-07 17-02-43
Vasco Pessanha
Merged this idea with 'Warning on infinite loop' (created on 16 Jun 2015 14:10:50 by Igor Kirtak)
This is a stupid situation, but it happens sometimes. Say you have "if" block (in logic), which goes to one or several actions, and then should return to normal flow. But than you accidentally put the arrow so that it goes back to "if". Later when you notice problems you can spend hours trying to figure out what is wrong, depending on the side effects this creates. Debugger doesn't always help - I've been in the situation when there was DB update inside of one of nested actions, and debugger was just stuck on it, so it was not clear where is the problem.

Off course this is human factor, but would be great if Service Studio noticed such infinite loops and gave a warning about it. As a simple way, It might warn on any flow which returns to original "if", or, a little more complex - just the one that doesn't have modifications of the variables used in "if" (since there is no thing like "break" in Outsystems, there are only 2 ways of exiting such kind of loop: a change of "if" result and exception).


This comment was:
- originally posted on idea 'Warning on infinite loop' (created on 16 Jun 2015 by Igor Kirtak)
- merged to idea 'Detect possible infinite loops in action flows and force the definition of max iterations' on 06 Sep 2018 14:20:51 by Vasco Pessanha
Duplicate of:

https://www.outsystems.com/ideas/289/detect-possible-infinite-loops-in-action-flows-and-force-the-definition-of-max-it

And would be solved by implementing:

https://www.outsystems.com/ideas/1855/while-loop-in-actions
https://www.outsystems.com/ideas/173/new-improved-action-tools
https://www.outsystems.com/ideas/965/for
https://www.outsystems.com/ideas/730/enhanced-for-each
https://www.outsystems.com/ideas/1141/exit-loop
https://www.outsystems.com/ideas/776/add-break-continue-on-cycles

:(

J.Ja


This comment was:
- originally posted on idea 'Warning on infinite loop' (created on 16 Jun 2015 by Igor Kirtak)
- merged to idea 'Detect possible infinite loops in action flows and force the definition of max iterations' on 06 Sep 2018 14:20:51 by Vasco Pessanha
2016-04-21 20-09-55
J.
 
MVP
Detection of infinite loops is pretty tough...

This comment was:
- originally posted on idea 'Warning on infinite loop' (created on 16 Jun 2015 by Igor Kirtak)
- merged to idea 'Detect possible infinite loops in action flows and force the definition of max iterations' on 06 Sep 2018 14:20:51 by Vasco Pessanha
Merged this idea with 'Infinite Loops. Add compilation warnings' (created on 15 Jul 2015 11:59:14 by Miguel Mendes)

Hello,


You really should implement a process during compilation that detects and warns about infinit loops(ex: a function calling itself, a "bad" IF flow).  A simple distraction can easily create an Infinite loop that will shut down an entire environment.





This comment was:
- originally posted on idea 'Infinite Loops. Add compilation warnings' (created on 15 Jul 2015 by Miguel Mendes)
- merged to idea 'Detect possible infinite loops in action flows and force the definition of max iterations' on 21 Mar 2019 03:09:49 by Justin James
Duplicate of:

https://www.outsystems.com/ideas/2027/warning-on-infinite-loop

Which is itself a duplicate.

J.Ja


This comment was:
- originally posted on idea 'Infinite Loops. Add compilation warnings' (created on 15 Jul 2015 by Miguel Mendes)
- merged to idea 'Detect possible infinite loops in action flows and force the definition of max iterations' on 21 Mar 2019 03:09:49 by Justin James
2016-04-21 20-09-55
J.
 
MVP
infinite loop of ideas? :)



This comment was:
- originally posted on idea 'Infinite Loops. Add compilation warnings' (created on 15 Jul 2015 by Miguel Mendes)
- merged to idea 'Detect possible infinite loops in action flows and force the definition of max iterations' on 21 Mar 2019 03:09:49 by Justin James
hahahaa good J. 

Just fowarding the Leo recent comment about this: 

"Well... detection of infinite loops is not attempted by any programming language. And for a good reason - it's an undecidable problem in computation theory. This means that it's an impossible task for any given computer."

So I think to detect a function calling itself or a "bad" IF flow is not so simple as it seems... 


This comment was:
- originally posted on idea 'Infinite Loops. Add compilation warnings' (created on 15 Jul 2015 by Miguel Mendes)
- merged to idea 'Detect possible infinite loops in action flows and force the definition of max iterations' on 21 Mar 2019 03:09:49 by Justin James
2014-02-07 17-02-43
Vasco Pessanha
Changed the category to
1CP


This comment was:
- originally posted on idea 'Infinite Loops. Add compilation warnings' (created on 15 Jul 2015 by Miguel Mendes)
- merged to idea 'Detect possible infinite loops in action flows and force the definition of max iterations' on 21 Mar 2019 03:09:49 by Justin James
Merged this idea with 'Service Studio Warnings for infinite loops or unescaped recursion' (created on 27 Mar 2021 14:08:09 by Helena Lameiro)

Hi,

it would be nice if service studio (auto-ML?) could warn if any infinite loop logic is implemented.

There are some kown anti-patterns:

  •  if conditions based on a variable that do not change on the loop with a branch that returns to the same point
  • call of the same action on recursion or nested actions with recursive calls without changing parameters
  • timers that have wake timer without an escape branch...

Even if patterns are known, they can easily remain unperceived on code reviews, it would great if it could be also applied in those anti-patterns detection, improving code quality minimizing errors.





This comment was:
- originally posted on idea 'Service Studio Warnings for infinite loops or unescaped recursion' (created on 27 Mar 2021 by Helena Lameiro)
- merged to idea 'Detect possible infinite loops in action flows and force the definition of max iterations' on 28 Mar 2021 18:34:01 by Justin James