Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-6403

computeIfAbsent is blocking and causing queries to be synchronized

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • querying
    • None

    Description

      Concurrent queries can be blocked reading attributes/fields/methods from an object.  The implementation to extract the attribute uses a concurrent hash map as a local cache.  computeIfAbsent is used on the local cache and was expected to return if the key was already present (without blocking).  Instead it looks like this is not how it behaves pre java 9.  See https://bugs.openjdk.java.net/browse/JDK-8161372  

       

      "Function Execution Processor4" #1057 daemon prio=10 os_prio=31 tid=0x00007fdf930cb800 nid=0x11837 runnable [0x000070001238a000]
      java.lang.Thread.State: RUNNABLE
      at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1674)

      • locked <0x00000007250d1ff8> (a java.util.concurrent.ConcurrentHashMap$Node)
        at org.apache.geode.cache.query.internal.AttributeDescriptor.getReadMember(AttributeDescriptor.java:149)
        at org.apache.geode.cache.query.internal.AttributeDescriptor.readReflection(AttributeDescriptor.java:97)
        at org.apache.geode.cache.query.internal.AttributeDescriptor.read(AttributeDescriptor.java:83)
        at org.apache.geode.cache.query.internal.PathUtils.evaluateAttribute(PathUtils.java:77)
        at org.apache.geode.cache.query.internal.CompiledPath.evaluate(CompiledPath.java:147)
        at org.apache.geode.cache.query.internal.CompiledID.evaluate(CompiledID.java:80)
        at org.apache.geode.cache.query.internal.CompiledComparison.evaluate(CompiledComparison.java:82)
        at org.apache.geode.cache.query.internal.QueryUtils.applyCondition(QueryUtils.java:429)
        at org.apache.geode.cache.query.internal.index.CompactRangeIndex.addToResultsFromEntries(CompactRangeIndex.java:831)
        at org.apache.geode.cache.query.internal.index.CompactRangeIndex.addToResultsFromEntries(CompactRangeIndex.java:711)

      Attachments

        Activity

          People

            boglesby Barrett Oglesby
            jasonhuynh Jason Huynh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: