bingmous

欢迎交流,不吝赐教~

导航

ConcurrentHashMap一直卡住bug

目录

    jdk11 ConcurrentHashMap bug,会一直卡在这里:

    "main" #1 prio=5 tid=0x00007f4bd8029800 nid=0xbd75 runnable [0x00007f4bde485000]
       java.lang.Thread.State: RUNNABLE
       JavaThread state: _thread_in_vm_trans
     - java.util.concurrent.ConcurrentHashMap.transfer(java.util.concurrent.ConcurrentHashMap$Node[], java.util.concurrent.ConcurrentHashMap$Node[]) @bci=338, line=2477 (Compiled frame)
            - locked <0x000000011bc70b38> (a java.util.concurrent.ConcurrentHashMap$ReservationNode)
     - java.util.concurrent.ConcurrentHashMap.addCount(long, int) @bci=276, line=2348 (Compiled frame)
     - java.util.concurrent.ConcurrentHashMap.computeIfAbsent(java.lang.Object, java.util.function.Function) @bci=570, line=1773 (Compiled frame)
     - org.springframework.cache.concurrent.ConcurrentMapCache.get(java.lang.Object, java.util.concurrent.Callable) @bci=14, line=142 (Compiled frame)
    
    

    jdk17中该方法修复:

     else if (f instanceof ReservationNode)
                                throw new IllegalStateException("Recursive update");
    

    posted on 2023-12-21 20:39  Bingmous  阅读(76)  评论(0编辑  收藏  举报