orpiske opened a new pull request, #13932:
URL: https://github.com/apache/camel/pull/13932

   I'd like a review on this one. 
   
   What's the problem here: ScheduledPollConsumer does non-atomic operations on 
volatile fields. For instance: 
   
   ```
   backoffCounter++
   ```
   
   That's a non-atomic operation because it does more than one operation (i.e.: 
fetch, add, update). So when multiple threads are watching for this value, 
there is a risk they may see corrupted values (as they may see the memory 
contents half-way in the operation). 
   
   This changes the code to use `AtomicInteger` and `AtomicLong` instead. 
   
   It also adjusts a test that seemed to wait for an specific number of cycles 
in the run loop (which is not clear to me why those numbers where chosen, hence 
the request for the review) . It should fix the flakiness on the test, but I 
left it isolated for now.


-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to