Add missing StepListenerMetaData entry for @OnChunkError - #5469
Open
benelog wants to merge 1 commit into
Open
Conversation
@OnChunkError was introduced in 6.0 and ChunkOrientedStepBuilder#listener(Object) scans for it, but StepListenerMetaData had no corresponding constant. The proxy returned by StepListenerFactoryBean therefore had nothing bound to onChunkError(Exception, Chunk), so an annotated method was registered and never invoked. No exception was thrown and no warning was logged. AFTER_CHUNK_ERROR does not cover this case: it maps to the deprecated ChunkListener#afterChunkError(ChunkContext), which only TaskletStep calls. ChunkOrientedStep calls onChunkError(Exception, Chunk) exclusively. Add ON_CHUNK_ERROR with the signature documented on the annotation, following ON_WRITE_ERROR which has the same (Exception, Chunk) shape. Resolves spring-projects#5468 Signed-off-by: Sanghyuk Jung <sanghyuk.jung@navercorp.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #5468
The parameter types follow
ON_WRITE_ERROR, which has the same(Exception, Chunk)shape. No other change was needed:ChunkOrientedStepBuilder#listener(Object)already scans for the annotation andStepListenerFactoryBeanreadsStepListenerMetaData.values().Points for review
AFTER_CHUNK_ERRORto keep the chunk callbacks together, which shifts the ordinals below it. Nothing reads the ordinal, but say the word if you would rather have it appended at the end.taskletListenerMetaData()is untouched. It feeds the XML namespace forTaskletStep, which callsafterChunkError(ChunkContext)and notonChunkError. Happy to exposeon-chunk-error-methodthere too if you want it in the namespace.@AfterChunkErroron a chunk-oriented step stays broken:listener(Object)does not scan for it. Since it maps to a method deprecated for removal in 6.2 thatChunkOrientedStepnever calls, wiring it up seemed like the wrong direction. Noted in the issue rather than fixed here.Verification
Besides the unit test in the diff, the reproducer from #5468 was re-run against a locally built
6.0.5-SNAPSHOT: