How do you kill/cancel/stop a Performance Analytics Job instance?

Michael Zglesze
Giga Expert

Hello Community!

How do you kill/cancel/stop a Performance Analytics Job instance?

Here's the situation:  I'm either building or testing things that I've built in Performance Analytics, and when I go to run the Historical Job to pull the last year or two of data, I see that one or more errors pops up immediately.  I look at the error, fix the error in under two minutes, but the current instance of that job continues to run, sometimes for hours, competing with any other jobs that are currently running, which may include another instance of the same newly-fixed job.

What is the solution to stopping a currently-running instance of a Performance Analytics job?

Thanks!

1 ACCEPTED SOLUTION

chris_lo
ServiceNow Employee
ServiceNow Employee

Hello Michael,



Terminating the job would entail that you know which specific app-node the job is running on. Customer's do not have access to check specific nodes so the best thing would be to contact support. Jobs on ServiceNOW run on scheduled workers so you would first need to be on the right node that is running the job and then you would need to validate that the job is running on one of the workers from that node. From here we would be able to kill the transaction from the 'All Active Transactions' module under the User Administration application menu. If you happen to manually execute the job you would then be able to see the job running from the stats page. You would also be able to see the transaction from the 'All active transactions' module. This only works if you run the job manually as the job would then execute from the node that you are on. Hope this helps.



-Chris



Sr. Technical Support Engineer


View solution in original post

11 REPLIES 11

Arnoud Kooi
ServiceNow Employee
ServiceNow Employee

I believe since Istanbul you should be able to use the OOB UI action Cancel Job



Cancel a data collection job


Cancel an active data collection job to stop the job from collecting scores.


Role required: pa_data_collector and schedule_admin, or admin


  • Navigate to Performance Analytics > Data Collector > Jobs.
  • Select the job you want to cancel.
  • Click Cancel Job.

Adam Stout
ServiceNow Employee
ServiceNow Employee

When I'm testing historical job and collecting a years worth of daily indicators what I normally do if I need to stop it is create a new BR on the fact table which set to run before query which adds in



current.addQuery('sys_id', '=', '-1');



This will ensure that no records are returned for the indicator source.   The current day will need to finish but the rest of the job should finish within a few second.   Very clean and no killing involved.   This works if you have a long running job but if you have an infinite loop in a script, this may not be sufficient.



Just be sure to delete the BR once you are done and be sure not to send it in an update set as it will prevent ALL QUERIES from running on the fact table.



When I have a job that I need to kill on a subprob (because we all only test new jobs on a subprod), I kill it via "Active Transactions (All Nodes)") which I believe you only need admin access to.