GCP Only - Gel Script Based Processes Never complete if the Custom Action runs for more than 1 Hour

book

Article ID: 206631

calendar_today

Updated On:

Products

Clarity PPM SaaS

Issue/Introduction

GCP Only - Gel Script Based Processes Never complete if the Custom Action runs for more than 1 Hour
 
STEPS TO REPRODUCE: 
1. Login to Clarity.
2. Navigate to Administration -> Objects.
3. Create a new custom Master object with ID "tso_resource_skills".
4. Auto-number both Name and ID columns.
5. Create a new process.
6. Under Start Step, add a new Custom Action.
7. Copy and paste the Attached GEL Script.
8. On the Database server which is hosting this PG database run the below command.
ALTER USER PPM_DB SET IDLE_IN_TRANSACTION_SESSION_TIMEOUT TO 60000;
9. Restart the APP&BG services.
10. Run the Process

Expected Results: Process Completes Successfully after Creating Custom Object Instances
Actual Results: Process never completes, but the custom object instances are created.

Cause

This is caused by DE59420

Resolution

This is fixed in 15.9.1

Additional Information

1. We see the below error on bg-ca.log
com.niku.union.utility.MessageKeyException: BPM-0545: An error occurred when executing custom action.
 at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:281)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.niku.bpm.BpmException: Cannot save CustomActionContext to the database
 at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:251)
 ... 3 more
Caused by: com.niku.bpm.BpmException: callPMD - Cannot execute statement: bpm.insertCustomActionContext_set
 at com.niku.bpm.customaction.persistence.CustomActionPersistenceUtils.callPMD(CustomActionPersistenceUtils.java:677)
 at com.niku.bpm.customaction.persistence.CustomActionPersistenceUtils.createCustomActionContext(CustomActionPersistenceUtils.java:411)
 at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:226)
 ... 3 more
Caused by: com.niku.union.persistence.PersistenceException: 
SQL error code: 0
Error message: FATAL: terminating connection due to idle-in-transaction timeout
SQL error code: 0
Error message: An I/O error occurred while sending to the back-end.

2. If we run the below query using postgress user on the database before the 60 secs of idle timeout are up we find that there is an "Idle in Transaction" session with SQL 
INSERT INTO BPM_ERRORS (
           ID, PROCESS_VERSION_ID, STEP_ID,
           STEP_ACTION_ID, STEP_ACTION_RESULT_ID, STEP_CONDITION_ID, PROCESS_INSTANCE_ID,
           STEP_INSTANCE_ID, TYPE_CODE, MESSAGE_CODE, ATTRIBUTE1, ATTRIBUTE2,
           EXCEPTION_TRACE2, CREATED_DATE,
           CREATED_BY, LAST_UPDATED_DATE, LAST_UPDATED_BY)
        VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17 )
  
3. If we query BPM_ERRORS we don't see any records being inserted, BG is just holding that session without performing any activity. 
4. In SaaS we have an Idle in Transaction timeout of 60 mins and any single Custom Script running for more than 60 mins doesn't complete.