[TIMOB-13208] Added cycle detection and made the code processor more tol...

...erant of long-running programs