Skip to main content

From time to time we get k2 developers that do something unexpected and put our k2 processes into an endless loop. I'm looking for ways to stop these process WITHOUT killing the K2HostServer services.


My current way is to stop the K2ServiceHost, find the _procinst record, update the status to 0 (error) and restart the K2ServiceHost. While this is effective, it's not a very good long term solution.


I've to use the Workspace and K2 Server API to do a StopProcessInstance but both just hang. 


Any Ideas?


 


 

The only way to stop an infinite loop for a process instance is the way you have described. The thread executing the loop will not release the instance since it is still executing and thus there is nothing you can do from an API or UI side to stop this execution. It is by design and expected.


 


If stopping the K2 Server is out of the question (like in Production environment), why don't you create a check in the usual place(s) where this occurs?You can then allow for a reasonable amount of retries based on standard execution and then do a GoTo when an infinite loop is suspected.


Reply