How to force kill a job

55 views
Skip to first unread message

Patrik Kosturák

unread,
Feb 4, 2019, 8:28:26 AM2/4/19
to schedulix
Hello,
I was working on Schedulix migration to a new db and server and I didn`t notice that 3 batches were running during the migration.
These batches contain jobs that are currently stuck in "canceling" state but the PID of the job no longer exists as they finished during the migration.
Please advise me on how to force kill a job manually.

These jobs are keeping a lock and because of them nothing else can run.
Thanks in advance.

Ronald Jeninga

unread,
Feb 4, 2019, 9:03:38 AM2/4/19
to schedulix
Hi Patrik,

just a moment ago I've discussed your issue with Dieter.
We now have a hypothesis what happened and what is causing the problems.

You probably didn't shut down the server first and pulled a backup of the database afterwards, but more vice versa.
During your backup (or just after the backup and before you shut down the server) some jobs finished.

The finish of those jobs isn't part of your backup.
Thus after starting the new server, it thinks that those jobs are still running (that's what the database tells it).

What has to be done is to simply repeat the messages from the jobservers to the scheduling server.
This means:

ALTER JOB xyz WITH STATE = FINISHED, EXIT CODE = 4711; /* or 0 or whatever */

(instead of xyz you enter the JOBID of the jobs to finish of course).

I hope our hypothesis is correct.

Best regards,

Ronald

PS:
the contents of the database is kept in sync with the contents of the server's memory.
This guarantees that if the database is safe, your entire system is safe.
This means that if you're going to manipulate the database (moving it to another instance is a kind of manipulation), ALWAYS shut down the scheduling server first! 
And never ever use SQL to manipulate the data within the database, unless we say so.

Patrik Kosturák

unread,
Feb 5, 2019, 3:45:53 AM2/5/19
to schedulix
Hello again,
thanks for help - it worked.
Reply all
Reply to author
Forward
0 new messages