Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaskletStep not marked as FAILED when FlatFileItemWriter fails to append footer [BATCH-1697] #1880

Closed
spring-issuemaster opened this issue Feb 18, 2011 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Feb 18, 2011

Stu Armitage opened BATCH-1697 and commented

The FlatFileItemWriter writes the footer when the ItemStream is closed.

However, for an TaskletStep the StepExecution is written to the JobRepository before the ItemStream is closed.

This means that any IOException from the FlatFileFooterCallback leaves the StepExecution marked as complete.

Dave suggests implementing the header/footer functionality via the StepExecutionListener interface in the forum post; this would mean that any exception would mark the Step as failed.


Affects: 2.1.0

Reference URL: http://forum.springsource.org/showthread.php?p=345767

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Sep 19, 2012

Michael Bannister commented

Dave, in the forum discussion, you suggest that

This is more of a feature than a bug - you aren't supposed to do business processing in ItemStream.close(), just clean up and free resources.

But StaxEventItemWriter uses its close() method to write closing XML tags; if that fails, the resultant file is invalid, so we really want the Step to be marked as failed...

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Sep 21, 2012

Dave Syer commented

I'm pretty sure this is a duplicate (maybe BATCH-1864). The comment I made is still true and so it's really a bug that the file writers use close() to call user-provided callbacks. THere was nothing we could do in 2.1.* but maybe in 2.2 we can modify some contracts or add a new one or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.