You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by YangLiu <sl...@126.com> on 2023/01/04 13:06:47 UTC

//Re:FastLRUCache/ConcurrentLRUCache computeIfAbsent is BLOCKED


Maybe this is a jdk “bug”, but it should be used incorrectly.

















At 2023-01-04 19:58:35, "slly" <sl...@126.com> wrote:
>Does anyone have similar problems?
>
>
>The cache class we configured is FastLRUCache  in solrconfig.xml
>
>
>   <filterCache class="solr.FastLRUCache" size="512" initialSize="512" autowarmCount="0"/>
>
>
>Many threads are blocking the stack below:
>
>
>  "qtp2141817446-2744893" #2744893 prio=5 os_prio=0 tid=0x00007f0b1b9f4800 nid=0x3ea9 waiting for monitor entry [0x00007f0b16bdd000]
>
>java.lang.Thread.State: BLOCKED (on object monitor)
>
>at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1674)
>
>- waiting to lock <0x000000030e8004a8> (a java.util.concurrent.ConcurrentHashMap$ReservationNode)
>
>at org.apache.solr.util.ConcurrentLRUCache.computeIfAbsent(ConcurrentLRUCache.java:226)
>
>at org.apache.solr.search.FastLRUCache.computeIfAbsent(FastLRUCache.java:259)
>
>at org.apache.solr.search.SolrIndexSearcher.getAndCacheDocSet(SolrIndexSearcher.java:876)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocSet(SolrIndexSearcher.java:825)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocSetBits(SolrIndexSearcher.java:788)
>
>at org.apache.solr.search.SolrIndexSearcher.getLiveDocSet(SolrIndexSearcher.java:897)
>
>at org.apache.solr.query.SolrRangeQuery.createDocSet(SolrRangeQuery.java:174)
>
>at org.apache.solr.query.SolrRangeQuery.createDocSet(SolrRangeQuery.java:168)
>
>at org.apache.solr.search.DocSetUtil.createDocSet(DocSetUtil.java:129)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocSetNC(SolrIndexSearcher.java:1197)
>
>at org.apache.solr.search.SolrIndexSearcher.lambda$getAndCacheDocSet$1(SolrIndexSearcher.java:876)
>
>at org.apache.solr.search.SolrIndexSearcher$$Lambda$823/1455346307.apply(Unknown Source)
>
>at org.apache.solr.search.FastLRUCache.lambda$computeIfAbsent$1(FastLRUCache.java:261)
>
>at org.apache.solr.search.FastLRUCache$$Lambda$824/1183964656.apply(Unknown Source)
>
>at org.apache.solr.util.ConcurrentLRUCache.lambda$computeIfAbsent$1(ConcurrentLRUCache.java:227)
>
>at org.apache.solr.util.ConcurrentLRUCache$$Lambda$825/1107818925.apply(Unknown Source)
>
>at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
>
>- locked <0x0000000310c00220> (a java.util.concurrent.ConcurrentHashMap$ReservationNode)
>
>at org.apache.solr.util.ConcurrentLRUCache.computeIfAbsent(ConcurrentLRUCache.java:226)
>
>at org.apache.solr.search.FastLRUCache.computeIfAbsent(FastLRUCache.java:259)
>
>at org.apache.solr.search.SolrIndexSearcher.getAndCacheDocSet(SolrIndexSearcher.java:876)
>
>at org.apache.solr.search.SolrIndexSearcher.getPositiveDocSet(SolrIndexSearcher.java:844)
>
>at org.apache.solr.search.SolrIndexSearcher.getProcessedFilter(SolrIndexSearcher.java:1035)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1558)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1439)
>
>at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:596)
>
>
>
>Thanks.
>
>
>
> 

Re://Re:FastLRUCache/ConcurrentLRUCache computeIfAbsent is BLOCKED

Posted by YangLiu <sl...@126.com>.

// from jdk1.8




"If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map unless null. The entire method invocation is performed atomically, so the function is applied at most once per key. Some attempted update operations on this map by other threads may be blocked while computation is in progress, so the computation should be short and simple, and must not attempt to update any other mappings of this map.
"
public V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {




The problem may be introduced by this change SOLR-15555






At 2023-01-04 21:06:47, "YangLiu" <sl...@126.com> wrote:



Maybe this is a jdk “bug”, but it should be used incorrectly.

















At 2023-01-04 19:58:35, "slly" <sl...@126.com> wrote:
>Does anyone have similar problems?
>
>
>The cache class we configured is FastLRUCache  in solrconfig.xml
>
>
>   <filterCache class="solr.FastLRUCache" size="512" initialSize="512" autowarmCount="0"/>
>
>
>Many threads are blocking the stack below:
>
>
>  "qtp2141817446-2744893" #2744893 prio=5 os_prio=0 tid=0x00007f0b1b9f4800 nid=0x3ea9 waiting for monitor entry [0x00007f0b16bdd000]
>
>java.lang.Thread.State: BLOCKED (on object monitor)
>
>at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1674)
>
>- waiting to lock <0x000000030e8004a8> (a java.util.concurrent.ConcurrentHashMap$ReservationNode)
>
>at org.apache.solr.util.ConcurrentLRUCache.computeIfAbsent(ConcurrentLRUCache.java:226)
>
>at org.apache.solr.search.FastLRUCache.computeIfAbsent(FastLRUCache.java:259)
>
>at org.apache.solr.search.SolrIndexSearcher.getAndCacheDocSet(SolrIndexSearcher.java:876)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocSet(SolrIndexSearcher.java:825)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocSetBits(SolrIndexSearcher.java:788)
>
>at org.apache.solr.search.SolrIndexSearcher.getLiveDocSet(SolrIndexSearcher.java:897)
>
>at org.apache.solr.query.SolrRangeQuery.createDocSet(SolrRangeQuery.java:174)
>
>at org.apache.solr.query.SolrRangeQuery.createDocSet(SolrRangeQuery.java:168)
>
>at org.apache.solr.search.DocSetUtil.createDocSet(DocSetUtil.java:129)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocSetNC(SolrIndexSearcher.java:1197)
>
>at org.apache.solr.search.SolrIndexSearcher.lambda$getAndCacheDocSet$1(SolrIndexSearcher.java:876)
>
>at org.apache.solr.search.SolrIndexSearcher$$Lambda$823/1455346307.apply(Unknown Source)
>
>at org.apache.solr.search.FastLRUCache.lambda$computeIfAbsent$1(FastLRUCache.java:261)
>
>at org.apache.solr.search.FastLRUCache$$Lambda$824/1183964656.apply(Unknown Source)
>
>at org.apache.solr.util.ConcurrentLRUCache.lambda$computeIfAbsent$1(ConcurrentLRUCache.java:227)
>
>at org.apache.solr.util.ConcurrentLRUCache$$Lambda$825/1107818925.apply(Unknown Source)
>
>at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
>
>- locked <0x0000000310c00220> (a java.util.concurrent.ConcurrentHashMap$ReservationNode)
>
>at org.apache.solr.util.ConcurrentLRUCache.computeIfAbsent(ConcurrentLRUCache.java:226)
>
>at org.apache.solr.search.FastLRUCache.computeIfAbsent(FastLRUCache.java:259)
>
>at org.apache.solr.search.SolrIndexSearcher.getAndCacheDocSet(SolrIndexSearcher.java:876)
>
>at org.apache.solr.search.SolrIndexSearcher.getPositiveDocSet(SolrIndexSearcher.java:844)
>
>at org.apache.solr.search.SolrIndexSearcher.getProcessedFilter(SolrIndexSearcher.java:1035)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1558)
>
>at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1439)
>
>at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:596)
>
>
>
>Thanks.
>
>
>
>