In case of SCDF Local Deployment, if the SCDF server goes down in between job execution, the STATE of job gets stuck at STARTED even after restart. #5502
Labels
type/enhancement
Is an enhancement request
This is in reference to #5498.
Trying out the sample BillRun application available as part of https://dataflow.spring.io/docs/batch-developer-guides/batch/data-flow-spring-batch/.
Now we want to check the behavior of a job if the SCDF server crashes.
So for the same I have modified BillProcessor class to add a delay of 2 minutes before the 3rd record is added to the database like,
public class BillProcessor implements ItemProcessor<Usage, Bill> {
@OverRide
public Bill process(Usage usage) {
if(usage.getFirstName().equals("michael"))
{
try {
Thread.sleep(120000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Double billAmount = usage.getDataUsage() * .001 + usage.getMinutes() * .01;
return new Bill(usage.getId(), usage.getFirstName(), usage.getLastName(),
usage.getDataUsage(), usage.getMinutes(), billAmount);
}
}
Now we launch the billRun task and the batch inserts the first 2 records into the DB and goes to sleep for 2 minutes,
We bring down the server now. After server restart the job execution status remains as STARTED,
So now its neither continuing on server startup with this status nor its allowing me to restart as the button is disabled,
So there should be a way to correct the STATUS of the job and option to restart the same from where it was left.
The text was updated successfully, but these errors were encountered: