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

Key: BATCH-457
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Dave Syer
Reporter: Gregory Kick
Votes: 0
Watchers: 0
Operations

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

Error handling broken in SimpleJob

Created: 13/Mar/08 02:45 PM   Updated: 14/Mar/08 03:54 AM
Component/s: Core
Affects Version/s: 1.0.0.m5
Fix Version/s: 1.0.0.rc1

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


 Description  « Hide
SimpleJob.execute() uses rethrow() to rethrow all Throwables caught during execution. rethrow checks to see if something is a RuntimeException and wraps it if it is not.

the issue is that anything that is an Error (OutOfMemory, StackOverflow, etc.) is caught and wrapped as an UnexpectedJobExecutionException. errors are inadvertently reclassified as exceptions.

honestly, i think that it's a little dodgy to be catching errors anyway, but if you must, rethrow needs to be corrected.

 All   Comments   Work Log   Change History   FishEye   Related Builds      Sort Order: Ascending order - Click to sort in descending order
Dave Syer - 13/Mar/08 05:16 PM
Why did you pick on SimpleJob? I doubt if it stops there (need to look at the step implementations as well I'm sure), so thanks for the pointer. Feel free to contribute test code or patches.

Dave Syer - 14/Mar/08 03:54 AM
Added some unit tests and made sure that RepeatTemplate, the two step implementations, and SimpleJob all re-throw Errors without wrapping.