Issue Details (XML | Word | Printable)

Key: BATCH-357
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: Lucas Ward
Votes: 0
Watchers: 0
Operations

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

Restart is broken.

Created: 12/Feb/08 11:21 PM   Updated: 19/Jun/08 02:28 AM
Component/s: Core
Affects Version/s: 1.0.0.m4
Fix Version/s: 1.0.0.m5

Time Tracking:
Not Specified


 Description  « Hide
I'm not sure how the restart job is working, but when looking at the simpleStepExecutor, the following code exists for restart:

result = processChunk(step, contribution);

// TODO: check that stepExecution can
// aggregate these contributions if they
// come in asynchronously.
ExecutionAttributes statistics = stepContext.getExecutionAttributes();
contribution.setExecutionAttributes(statistics);
contribution.incrementCommitCount();

// If the step operations are asynchronous then we need
// to synchronize changes to the step execution (at a
// minimum).
synchronized (stepExecution) {

// Apply the contribution to the step
// only if chunk was successful
stepExecution.apply(contribution);

if (saveExecutionAttributes) {
stepExecution.setExecutionAttributes(stepContext.getExecutionAttributes());
}
jobRepository.saveOrUpdate(stepExecution);

Essentially, only the execution attributes from the step context are being persisted. However, the ItemReaders don't push to the context, they have ExecutionAttributes requested by the stream manager. As you can see above, streamManager.getExecutionAttributes() is not called.

 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Lucas Ward added a comment - 15/Feb/08 05:39 PM
I was mistaken, the StepContext has a reference to the StreamManager, so Restart isn't broken. It still seems really weird to me, but this issue should be closed.