ajithme opened a new pull request #27071: [SPARK-30406] OneForOneStreamManager 
ensure that compound operations on shared variables are atomic
URL: https://github.com/apache/spark/pull/27071
 
 
   Using compound operations as well as increments and decrements on primitive 
fields are not atomic operations. Here when volatile primitive field is 
incremented or decremented,  we run into data loss if threads interleave in 
steps of update. 
   
    Refer: 
https://wiki.sei.cmu.edu/confluence/display/java/VNA02-J.+Ensure+that+compound+operations+on+shared+variables+are+atomic
   
   ### What changes were proposed in this pull request?
   Using `AtomicLong` instead of `long`
   
   ### Why are the changes needed?
   volatile primitive field is incremented or decremented,  we run into data 
loss if threads interleave in steps of update. 
   
   
   ### Does this PR introduce any user-facing change?
   No
   
   
   ### How was this patch tested?
   All Existing UT can pass with the Change

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to