songwdfu opened a new pull request, #16291:
URL: https://github.com/apache/pinot/pull/16291

   Fix #16290 . ConcurrentSkipListMap's 
[compute](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentSkipListMap.html#compute-K-java.util.function.BiFunction-)
 method is not thread-safe. Instead this PR uses 
[putIfAbsent](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentSkipListMap.html#putIfAbsent-K-V-)
 and 
    
[replace](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentSkipListMap.html#replace-K-V-V-)
 methods in a compare-and-swap manner to fix it.
   
   A test is supplied that the original impl fails upon.
   
   The performance penalty is not significant when testing locally. 
   Benchmark                                                     Mode  Cnt     
Score      Error  Units
   before                                                              avgt    
3  7365.805 ± 1578.375  us/op
   after                                                                 avgt   
 3  7062.490 ± 4415.175  us/op


-- 
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]


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

Reply via email to