-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[BATCH-2762] Introducing SynchronizedItemStreamWriter #665
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
Conversation
Also introducing SynchronizedItemStreamWriterBuilder. Multi-threaded Tests have been that additionally prove that currently ItemStreamWriter is not thread-safe.
The multi-threaded tests are inspired by the construct in SynchronizedItemStreamReaderTests but it follows slightly different approach:
Also realised that the existing SynchronizedItemStreamReaderTests is not actually properly working as the threads are not being started correctly - they are just invoking directly the run() method. I can fix this on a separate PR. |
decorators section
...cture/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamWriter.java
Outdated
Show resolved
Hide resolved
...cture/src/main/java/org/springframework/batch/item/support/SynchronizedItemStreamWriter.java
Show resolved
Hide resolved
@dimitrisli Thank you for this PR! The synchronized item writer and its builder LGTM. However, when I see the tests, it feels like we are trying to test the I think calling the synchronized writer and make sure the delegate was called is already ok. I know you said you took inspiration from I added a couple of minor inline comments, if you can address them the PR should be good to merge. Thank you upfront. |
Thank you for the updates @dimitrisli !
Do you agree on simplifying tests? I did not request a change for that (I can do it when merging your PR unless you want to push a second update), but at least I wanted to know if you agree on that. |
@benas totally agree. I've removed the concurrency tooling and focused on the delegate pass-through methods calling |
@dimitrisli Great! LGTM now. Rebased, squashed and merged as 117b7d5. Please note that I applied some minor changes (update year in license headers, update javadoc, etc, see 9fbd3da). Thank you for your contribution! |
Also introducing SynchronizedItemStreamWriterBuilder. Multi-threaded
Tests have been that additionally prove that currently ItemStreamWriter
is not thread-safe.