Symptoms
Process is on a loop and can't be stopped.
Diagnoses
I created a server event with custom code in a K2 Process. The process was throwing an error, so I wanted to debug the process. I added an infinite sleep loop in the process, with the intention of attaching to the process and then stepping passed the loop in the process. When I tried to attach to the process, the code would not "hit" the breakpoint. Therefore the process is stuck in the infinite loop.
I then tried to go to workspace and stop the process. Workspace was unable to stop the process.
I then tried turning the server off, and turning it back on. Then I went into workspace and tried to stop the process. This did not work.
How can I stop this process from using the server's resources?
Resolution
The way to stop a process that is on a loop or stuck is thru the database. These are the steps on how to do it.
1. Stop the K2 Service
2. Identify the running instances:
Status = 1 (Running)
Status = 4 (Stopped)
Consolidated DB = SELECT * FROM K2].OServer].SProcInst] where Status = 1
Multiple DB's = SELECT * FROM CK2Server].Kdbo].e_ProcInst] where Status = 1
3. Identify the instance by start time or Folio and change the status to 4 to stop it:
Consolidated DB = Update DK2].UServer].2ProcInst] set status= 4 where ID = 1234 and ProcID =1234
Multiple DB's = Update 'K2Server]. dbo].r_ProcInst] set status= 4 where ID = 1234 and ProcID =1234
4. Start the K2 Service.