Long-running background processes on a scoped-application and Quota Rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2016 08:57 AM
Hi,
does anyone experienced problems with long running background processes on a scoped-application. The problem that Fuji introduced some undocumented Quota Rule "Scoped Background Transactions" that cancels any background process after 10 min (600 sec).
The background process is started using the following code:
var worker = new GlideScriptedHierarchicalWorker();
worker.setProgressName('Test Worker');
worker.setBackground(true);
worker.setScriptIncludeName('scope._TestWorker');
worker.setScriptIncludeMethod('process');
worker.putMethodArg('timeout', timeout);
worker.start();
After 10 min the process is canceled. The corresponding entry under Progress Workers is in Canceled state and there is a record in the log
Cancelling transaction ProgressWorkerThread - Test Worker (maximum execution time exceeded): Thread Test Worker (Test Worker, SYSTEM), after 600891ms
The problem that this Quota Rule is protected and it will be hard to convince customers to increase the timeout using some hacks like export/import. We also tried to override the Quota Rule, but without any success. It looks like that all rules with matched condition are applied. Therefore even if custom rule is defined before or after the system rule, system rule is applied and there is no way to override it. At least we didn't succeed with it.
Are there any way to start background process on the scoped application that are running longer than 10 min? Or probably someone has experience with defining custom rule that overrides the system rule.
Thanks
Regards
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2016 04:08 PM
I'm having the same issue importing and transforming records into a scoped app. Did you get anywhere with the issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2016 01:17 AM
we were trying to get some explanation from the ServiceNow dev team but unfortunately still didn't get any answer.
In our case the solution was to decompose long running process into smaller parts and execute the process as a workflow. The trick is to include Timer activity with a 1 sec delay between Run Script activities. In this case every activity will initiate new background process and therefore Quota Rules will be applied to every Run Script activity.
I know that this is a temporary solution and will not solve the problem in all cases, therefore we hope to get some info from the ServiceNow team. I will keep you posted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2016 11:50 AM
I'm having the same issue with importing data into a scoped application's table. I could split the file, but I'd end up with no less than 20 files as a result. That's not useful. Please let us know if you get anywhere with this.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2016 12:20 PM
Customer service WILL unlock the rule and let you change it if you justify the reason... so open hi ticket if you need to over ride the rule.