Symptoms
Timeout error in K2 SmartForms
Diagnoses
While accessing the K2 SmartForms and opening the K2 worklist item using K2 API we are getting the following error:
"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached." Also attached the screenshot from SmartForms.
Following errors getting logged in K2 host server log in addition to this:
10032 SmartObject Server exception source: Exception Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.]
64007 Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
8060 ProcessPacket Error, Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
2025 Error Marshalling SourceCode.Forms.Runtime.ClientServer.GetUserProfileAx, Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Resolution
We discovered that there were process instances stuck in a running state after running some select queries against the Server].tProcInst] table.
.ServerLog].>Status] table will hold what the value is for each group for process instances:
0 Error
1 Running
2 Active
3 Completed
4 Stopped
5 Deleted
Stopping the K2 blackpearl service and putting these instances in a stopped state resolved the timeout and max pool size errors. Customer will work with engineering team investigate why these process instances are stuck in a running state.