History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BATCH-437
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Dave Syer
Reporter: Robert Kasanicky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

sensible restart logic

Created: 07/Mar/08 02:41 AM   Updated: 10/Mar/08 10:40 AM
Component/s: Execution
Affects Version/s: 1.0.0.m5
Fix Version/s: 1.0.0.rc1

Time Tracking:
Original Estimate: 0.12d
Original Estimate - 0.12d
Remaining Estimate: 0.12d
Remaining Estimate - 0.12d
Time Spent: Not Specified
Remaining Estimate - 0.12d


 Description  « Hide
Despite the long discussion in BATCH-372 we still haven't fixed the awkward step-oriented restart logic. To summarize once again, every step always investigates its execution history to figure out whether it should restore its state. In case of freshly created JobInstance (= most of the time) it is completely useless activity. In restart scenario there is still just single crashed step that needs to be restored, not all of them.

The consensus from BATCH-372 seems to be we should push the restart concern from Step up to the Job level.

 All   Comments   Work Log   Change History   FishEye   Related Builds      Sort Order: Ascending order - Click to sort in descending order
Dave Syer - 07/Mar/08 03:50 AM
It is still an important feature to be able to always re-run a step irrespective of its history (once the job has decided top restart), but the default should be not to re-run steps that already completed. The point is that the job can ask the step to make that kind of decision, so there is at least some encapsulation. Since it is encapsulated I'm not sure this is really critical. I think we could change this in the future if we needed to (maybe not in a point release). Am I missing something?

Robert Kasanicky - 07/Mar/08 04:02 AM
I've assigned high priority because the issue basically translates to "restart logic makes little sense" - I think that's serious by itself. Second, in case we fix it I assume significant positive consequences e.g. breaking the cyclic dependency between JobExecution and StepExecution and resolving the StepExecution's obscure status somewhere between entity and value object. I think the awkward restart logic is the primary client of other design obscurities, so it needs to be fixed first to get free hands for further improvements.

Dave Syer - 08/Mar/08 06:28 AM
I have moved the code that deals with the last ExecutionContext up from ItemOrientedStep up to the SimpleJob, so that the TaskletStep can benefit from it as well.

Lucas Ward - 10/Mar/08 10:40 AM
I'm making this as fixed, since Dave's change puts restart logic in a more logical place, and the bi-directional parent child relationship of job execution and step execution isn't going to be changed.