greyp9 commented on PR #9445:
URL: https://github.com/apache/nifi/pull/9445#issuecomment-2437809149

   > @pvillard31 Thanks for your analysis on the issue! The missing piece of 
the puzzle is that the `successes` list is not synchronized and the callback 
threads write the list in parallel in `TrackedApiFutureCallback.onSuccess()` 
which caused lost items (the same is true for the `failures` list). So the 
issue could be fixed via adding some synchronization stuff around the lists 
(e.g. `synchronized` block, `Collections.synchronizedList()` or 
`CopyOnWriteArrayList`). I have not checked your solution in detail and I have 
no strong opinion at the moment. Just wanted to clarify the root cause and to 
mention other possible solutions to it.
   
   Thanks @turcsanyip - this is my analysis as well.  Once I had things set up, 
this issue was fairly easy to reproduce.  After adding synchronization to the 
`successes` and `failures` lists, the logic ran cleanly, even when loaded.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to