You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/11/11 14:04:29 UTC

[GitHub] [pulsar] Jason918 edited a comment on issue #12723: Race condition in PersistentTopic#addReplicationCluster

Jason918 edited a comment on issue #12723:
URL: https://github.com/apache/pulsar/issues/12723#issuecomment-965011704


   I found another interesting thing is that in org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap, if we call `map.put(key, null)`, it throws an NullPointerException. But we can use `map.computeIfAbsent(key, k->null)` to insert a null value into the map, which leads to a confusing situation that `map.containsKey(key)` is falsse, but there is actually a "key" in the map with null value.
   
   Not the same behavior in java.util.concurrent.ConcurrentHashMap, a key with null value will be dismissed.


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