Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

group.isMember(authUser) is slow sometimes in 6.1

Avatar

Level 2

Hi,

We are trying to verify the user access by using group.isMember(authUser) method. Usually this method call takes less than 5secs, but sometimes it takes more than 30 secs. we have captured the thread dump, but we don't see any lock in there. We are seeing the below stack trace getting repeated 


"qtp712906181-63017" prio=10 tid=0x00007f2dc099f800 nid=0x58cd runnable [0x00007f29c8a9b000]
   java.lang.Thread.State: RUNNABLE
        at org.apache.jackrabbit.oak.plugins.segment.Segment.<init>(Segment.java:155)
        at org.apache.jackrabbit.oak.plugins.segment.Segment.<init>(Segment.java:147)
        at org.apache.jackrabbit.oak.plugins.segment.file.FileStore.readSegment(FileStore.java:839)
        at org.apache.jackrabbit.oak.plugins.segment.SegmentTracker.getSegment(SegmentTracker.java:136)
        at org.apache.jackrabbit.oak.plugins.segment.SegmentId.getSegment(SegmentId.java:108)
        - locked <0x00000006649ea3a8> (a org.apache.jackrabbit.oak.plugins.segment.SegmentId)
        at org.apache.jackrabbit.oak.plugins.segment.Record.getSegment(Record.java:82)
        at org.apache.jackrabbit.oak.plugins.segment.MapRecord.getEntry(MapRecord.java:154)
        at org.apache.jackrabbit.oak.plugins.segment.MapRecord.getEntry(MapRecord.java:186)
        at org.apache.jackrabbit.oak.plugins.segment.MapRecord.getEntry(MapRecord.java:186)
        at org.apache.jackrabbit.oak.plugins.segment.MapRecord.getEntry(MapRecord.java:186)
        at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.getChildNode(SegmentNodeState.java:383)
        at org.apache.jackrabbit.oak.plugins.index.property.strategy.UniqueEntryStoreStrategy.count(UniqueEntryStoreStrategy.java:180)
        at org.apache.jackrabbit.oak.plugins.index.property.strategy.UniqueEntryStoreStrategy.count(UniqueEntryStoreStrategy.java:194)
        at org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexPlan.<init>(PropertyIndexPlan.java:146)
        at org.apache.jackrabbit.oak.plugins.index.property.PropertyIndex.plan(PropertyIndex.java:134)
        at org.apache.jackrabbit.oak.plugins.index.property.PropertyIndex.getCost(PropertyIndex.java:167)
        at org.apache.jackrabbit.oak.query.QueryImpl.getBestSelectorExecutionPlan(QueryImpl.java:866)
        at org.apache.jackrabbit.oak.query.QueryImpl.getBestSelectorExecutionPlan(QueryImpl.java:795)
        at org.apache.jackrabbit.oak.query.ast.SelectorImpl.prepare(SelectorImpl.java:284)
        at org.apache.jackrabbit.oak.query.QueryImpl.prepare(QueryImpl.java:570)
        at org.apache.jackrabbit.oak.query.QueryEngineImpl.executeQuery(QueryEngineImpl.java:183)
        at org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.resolveUUID(IdentifierManager.java:314)
        at org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.getPath(IdentifierManager.java:189)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:259)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:237)
        at org.apache.jackrabbit.commons.iterator.AbstractLazyIterator.hasNext(AbstractLazyIterator.java:39)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:249)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:237)
        at org.apache.jackrabbit.commons.iterator.AbstractLazyIterator.hasNext(AbstractLazyIterator.java:39)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:249)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:237)
        at org.apache.jackrabbit.commons.iterator.AbstractLazyIterator.hasNext(AbstractLazyIterator.java:39)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:249)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:237)
        at org.apache.jackrabbit.commons.iterator.AbstractLazyIterator.hasNext(AbstractLazyIterator.java:39)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:249)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider$2.getNext(MembershipProvider.java:237)
        at org.apache.jackrabbit.commons.iterator.AbstractLazyIterator.hasNext(AbstractLazyIterator.java:39)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider.isMember(MembershipProvider.java:305)
        at org.apache.jackrabbit.oak.security.user.MembershipProvider.isMember(MembershipProvider.java:290)
        at org.apache.jackrabbit.oak.security.user.GroupImpl.isMember(GroupImpl.java:226)
        at org.apache.jackrabbit.oak.security.user.GroupImpl.isMember(GroupImpl.java:91)

 

 Kindly help me on this.

Regards,

Gowrishankar

1 Accepted Solution

Avatar

Correct answer by
Level 10

Looking at this:  at org.apache.jackrabbit.oak.query.QueryImpl.prepare

I suspect this may be related to OAK querying/indexing. When querying with OAK. you need to do OAK indexing to improve Queries.

See this GEMS session on OAK indexes to understand it: 

http://dev.day.com/content/ddc/en/gems/oak-lucene-indexes.html

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Looking at this:  at org.apache.jackrabbit.oak.query.QueryImpl.prepare

I suspect this may be related to OAK querying/indexing. When querying with OAK. you need to do OAK indexing to improve Queries.

See this GEMS session on OAK indexes to understand it: 

http://dev.day.com/content/ddc/en/gems/oak-lucene-indexes.html