cancel
Showing results for 
Search instead for 
Did you mean: 

Infinite loop

AntonioValverde
Level 2
Exists any way to detect an infite loop from control room and in that case stop the process automatically?
2 REPLIES 2

John__Carter
Staff
Staff
Not really, as there are different causes of infinite loop. Prevention is the best cure, so having a robust design and build review procedures is recommended to maintain quality, and that things like loop counters are used and that dangerous nesting of exception handling is avoided. From control room, maybe the logs can reveal that the process is repeating the same steps over and over? Or maybe if the queue isn't going down normally? To me, if there is a process that has fallen into an infinite loop then it needs to be redesigned, rather than looking for ways to detect when an infinite loop is happening.  

BenKirimlidis
Level 7
There's no way to detect when an infinite loop is occuring.  Process should be redesigned. If it is occuring following a failed action you can add a retry counter and only allow X number of attempts before throwing an exception. If it is a system waiting for some output and the process is looping endlessly (e.g. sending 'ENTER' waiting for some 'Action Successful' response in a mainframe system), perhaps you can count how many times the action is occuring before throwing an exception in a similar way. But redesign is probably the best bet.  Before attempting to carry out an axction, determine if the previous action was successful and if your application is displaying the right screen before attemptign to send the next action to be performed.  More up front investment in terms of development time but savesa headaches like this down the line. This happened to me at one point, a process would go into infinite loop that teh dev hadn't anticipated.  All steps were being logged, our DB was being filled up with logging data at a rate of ~300MB per minute at the time.  We exhausted every avenue we could to try and find a way of finding an infinite loop natively in BP application.  Maybe something exists that we missed but i don't think so.  happy to be proven wrong though if anyone else has any ideas!