Replies: 3 comments 1 reply
-
|
Thank you for reporting these issues and for providing an example! If I understand correctly, those issues only happen when an exception is thrown in the writer. There seems to be a gap in our test suite for local chunking in I will add a test for that case and schedule the fix for the next release.
This is probably related to #5247 |
Beta Was this translation helpful? Give feedback.
-
|
Hi @ctrung
Fixed in #5336
Fixed in #5337
That actually was unclear in the docs. In a local chunking setup, the driving step will read items and write chunk requests in the task executor's queue, which are then handled by workers. Each worker should report its write count / write skip count, and those of the driving step should be reset before the aggregation (fixed in #5337 as well). So it is actually the reponsibility of the chunk processor (ie the client) to update those counters (note that the read/process/filter counts are still managed by the driving step).
I added some logging in the chunking writer, but any logging about transaction management or fault tolerance is also the reponsibility of the client (ie the chunk processor)
This was actually not documented, but chunk scanning is the responsibility of the chunk processor (as the driving step will only prepare chunks and send them to workers where all the processing happens). I updated the documentation of that in #5338 With that, I think I have addressed what you reported here, and the fixes will be shipped in 6.0.3. I am going to close this discussion for now, but if you still have any issues, please report them and I will address then in the next iteration. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you.
I didn't realised that since it was supported out of the box in v5, but again, things were implemented differently... There's still a typo in the local chunking chapter, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I found some inconstencies with local chunking when an exception is thrown in an itemWriter.
Exceptions are not stored inside
jobExecution#getAllFailureExceptions()andstepExecution#getFailureExceptions()whereas they are when not using local chunking. I'm using a job listener in production to send mail reports when a job ends in a FAILED state. I'm usingjobExecution#getAllFailureExceptions()to retrieve them and was surprised to get a NoSuchElementException when local chunking is configured. I resolved this by usingstepExecution#exitStatusinstead (seems to work in all job configurations).Also, step execution counts for rollback and commit differ. Rollbacks are not counted (they are counted as commits instead) whereas when not using local chunking, commits and rollbacks are correct.
(unrelated and minor) In the documentation, the chukingProcessor snippet increments the write counts but these are already updated by Spring Batch.
No exception is logged whereas when not using local chunking one would see ERROR logs such as
ChunkOrientedStep : Rolling back chunk transaction + <stacktrace>andAbstractStep : Encountered an error executing step step in job job + <stacktrace>). The absence of logs plus the use of aResourcelessJobRepository(hence no post mortem insights of the job execution) plus a notification report that didn't work (point 1) made problem analysis very hard 😰.(not in demo.zip) If a skipping policy is also configured in the step definition (eg.
.faultTolerant().skipPolicy(new AlwaysSkipItemSkipPolicy())), the whole chunk is skipped whereas when not using local chunking only items triggering an exception are skipped.Reproducible code with Spring Boot v4.0.2 + Spring Batch v6.0.2 : demo.zip
Thanks for your feedback.
Beta Was this translation helpful? Give feedback.
All reactions