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

Key: BATCH-435
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Robert Kasanicky
Reporter: Lucas Ward
Votes: 1
Watchers: 1
Operations

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

TaskletStep does not report interruption correctly.

Created: 06/Mar/08 02:00 PM   Updated: 10/Mar/08 04:39 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
The TaskletStep doesn't store that a job was interrupted correctly. For example, if someone implements a tasklet that returns ExitStatus.INTERUPTED, a BatchStatus of FINISHED will be returned, which is not ideal. Also, if a JobInterruptedException is thrown, a BatchStatus of FAILED will be stored, instead of STOPPED.

 All   Comments   Work Log   Change History   FishEye   Related Builds      Sort Order: Ascending order - Click to sort in descending order
Robert Kasanicky - 07/Mar/08 06:14 AM
I think the ExitStatus.INTERRUPTED should be removed and the JobInterruptedException should be used to signal interruption uniformly.

Robert Kasanicky - 07/Mar/08 06:53 AM - edited
Afterall the current state makes sense to me - why should the step care whether it failed or was interrupted? The step simply failed due to interruption - the BatchStatus.STOPPED on JobExecution says it all. Adding interruption handling on step level seems like an unnecessary duplication to me - the step can safely ignore interrupt concerns (if we switch to using the interrupt aspect anyway).

Assaf Berg - 08/Mar/08 08:56 AM
I think the problem with TaskletStep is that it catches JobInterruptedException and treats it like any other exception - marks the batch as failed. Instead, it should let the JobInterruptedException propagate to the job (as ItemOrientedStep does), which will set the status to STOPPED.

Dave Syer - 08/Mar/08 09:12 AM
I agree with that analysis. There is some value in the STOPPED status. The only slight flow is that most Tasklets will never throw that exception, but I guess that should matter to the step implementation.

Robert Kasanicky - 10/Mar/08 04:39 AM
TaskletStep now rethrows JobInterruptedException without wrapping it