looly commented on code in PR #11987:
URL: https://github.com/apache/dubbo/pull/11987#discussion_r1172222681
##########
dubbo-common/src/main/java/org/apache/dubbo/common/utils/ConcurrentHashMapUtils.java:
##########
@@ -35,7 +35,18 @@ public static <K, V> V computeIfAbsent(ConcurrentMap<K, V>
map, K key, Function<
if (JRE.JAVA_8.isCurrentVersion()) {
V v = map.get(key);
if (null == v) {
- v = map.computeIfAbsent(key, func);
+ // issue#11986 lock bug
+ // v = map.computeIfAbsent(key, func);
+
+ // this bug fix methods maybe cause `func.apply` multiple
calls.
+ v = func.apply(key);
Review Comment:
yes
--
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]