Background Job Executing Twice for Single Request Causing Duplicate Records in Production

itshimesh23
Giga Contributor

Hi everyone,

We are facing an issue in Production where a background job is executing twice for a single Service Catalog request, resulting in duplicate records being created in my custom table sn_vul_custom_table1. In our setup, after request approval, a Run Script queues a background job which then executes a Script Include (global.myScriptIncludeProcess) to perform operations like adding URLs to Custom Table 1 and Custom Table 2.

Recently, we tested a request (RITM26009192551) to add two URLs into the sn_vul_custom_table1 table. Only one background job (SECJOB0504717) was created, but duplicate records were inserted. On checking system logs, we found that the log message “ODIN BG: execute() invoked for job SECJOB0504717” appears twice, confirming that the Script Include ran twice even though the job was scheduled only once.

However, in another request (RITM26009193805) where URLs were added to the sn_vul_custom_table2 table, the background job (SECJOB0504718) executed only once and no duplicate records were created. The logs also confirm that the Script Include executed only once in that case.

We have verified that only one job record exists for each RITM and only one workflow context is created, so the workflow is not restarting. This issue has only been observed in Production and not in lower environments (Dev/UAT/Training).

Has anyone faced a similar issue where a single background job executes multiple times in a multi-node environment or SecOps background job framework? Any guidance on why this double execution might be happening and how to prevent it would be greatly appreciated.

0 REPLIES 0