-
Nov 9th, 2009, 01:47 PM
#1
Stopping a job manually
Hello,
I have a job that contains two steps running in parallel (split flow).
I am trying to stop a job manually using the JobOperator.stop() method. On random basis, one of the steps doesn't stop and continues running until the records read finish.
After stopping the job, the job execution status is set to STOPPED and the step execution of the first step changes to STOPPED while the second remains STARTED. I debugged and found out that the step's terminateOnly field is not being set to true.
I tried calling the JobExecution.stop() method which directly calls the setTerminateOnly() method. Still the random error occurred.
In the end, I applied this workaround to ensure that the two steps stopped:
while (!stepExecution.isTerminateOnly()) {
stepExecution.setTerminateOnly();
}
Do you have an idea about this?
Thanks,
Marwan
-
Nov 10th, 2009, 06:48 AM
#2
I didn't understand the workaround. Where did you put that code? Where did the stepExecution come from?
-
Nov 10th, 2009, 07:20 AM
#3
Forget about the piece of code, actually this was a false test. It didn't work. The stepExecution still had the terminateOnly set to false.
I tried to get the stepExecution from the jobExecution which I got from the jobExplorer.
So any ideas how to solve this?
-
Nov 10th, 2009, 07:33 AM
#4
Looks like a bug to me (raise a JIRA if you want to track it). I guess you could install a ChunkListener that checks its parent JobExecution for STOPPING *or* STOPPED and sets the StepExecution to terminate if detected.
-
Nov 15th, 2009, 01:08 PM
#5
Issue created: BATCH-1442
I will also test the workaround.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules