You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "michaeljmarshall (via GitHub)" <gi...@apache.org> on 2023/10/05 13:54:31 UTC

[I] [Bug] Incorrect usage of ConcurrentSkipListMap#computeIfAbsent [pulsar]

michaeljmarshall opened a new issue, #21301:
URL: https://github.com/apache/pulsar/issues/21301

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Version
   
   master
   
   ### Minimal reproduce step
   
   ConcurrentSkipListMap#computeIfAbsent does not guarantee only calling the supplier atomically when the value is not present. The following usage appears to be side effecting code that will likely break due to misuse of this method:
   
   https://github.com/apache/pulsar/blob/82237d3684fe506bcb6426b3b23f413422e6e4fb/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/util/RangeCache.java#L78-L82
   
   ### What did you expect to see?
   
   We need to make sure that we only increment those atomic counters once.
   
   ### What did you see instead?
   
   There is a chance we'll increment the counters in certain race conditions.
   
   ### Anything else?
   
   Relevant context can be found here: https://github.com/datastax/cassandra/pull/789#discussion_r1346445456
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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-unsubscribe@pulsar.apache.org.apache.org

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


Re: [I] [Bug] Incorrect usage of ConcurrentSkipListMap#computeIfAbsent [pulsar]

Posted by "codelipenghui (via GitHub)" <gi...@apache.org>.
codelipenghui closed issue #21301: [Bug] Incorrect usage of ConcurrentSkipListMap#computeIfAbsent
URL: https://github.com/apache/pulsar/issues/21301


-- 
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-unsubscribe@pulsar.apache.org

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