jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Parvulescu (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (JCR-3082) occasional index out of bounds exception while running UserManagerImplTest.testFindAuthorizableByRelativePath
Date Mon, 03 Oct 2011 13:58:34 GMT

     [ https://issues.apache.org/jira/browse/JCR-3082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alex Parvulescu updated JCR-3082:
---------------------------------

    Attachment: JCR-3082.patch

It would appear that the DescendantSelfAxisScorer does not respect the DocIdSetIterator API
on the advance() method.

The BooleanScorer2 has 2 scorers: a DescendantSelfAxisScorer and a MultiScorer.
When the MultiScorer is finished, the BooleanScorer2 will call advance on the DescendantSelfAxisScorer
with a Integer.MAX_VALUE.

Because the DescendantSelfAxisScorer does not respect the api, instead of exausting the scorer,
it only calls "subScorer.nextDoc()" once, thus reverting the current docId, to a smaller value,
instead of NO_MORE_DOCS.
This propagates through all the embedded scorers, acting like there are more docs in the current
query, when in fact there are no more.

I'm attaching a patch for this specific advance(Integer.MAX_VALUE) on the DescendantSelfAxisScorer
that apparently fixes the problem.

The DescendantSelfAxisScorer still does not comply with the api, and it would be interesting
to look at the other existing implementations in JR, to check for compliance.

At the very least we should enable this optimization for the case where it is called with
NO_MORE_DOCS, to shortcut to the end of the stream.






                
> occasional index out of bounds exception while running UserManagerImplTest.testFindAuthorizableByRelativePath
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-3082
>                 URL: https://issues.apache.org/jira/browse/JCR-3082
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Julian Reschke
>         Attachments: JCR-3082.patch
>
>
> Stack trace:
> java.lang.ArrayIndexOutOfBoundsException: 8
> 	at org.apache.jackrabbit.core.query.lucene.MultiScorer.score(MultiScorer.java:89)
> 	at org.apache.lucene.search.ConjunctionScorer.score(ConjunctionScorer.java:133)
> 	at org.apache.lucene.search.BooleanScorer2$2.score(BooleanScorer2.java:182)
> 	at org.apache.lucene.search.BooleanScorer2.score(BooleanScorer2.java:303)
> 	at org.apache.jackrabbit.core.query.lucene.LuceneQueryHits.nextScoreNode(LuceneQueryHits.java:68)
> 	at org.apache.jackrabbit.core.query.lucene.QueryHitsAdapter.nextScoreNodes(QueryHitsAdapter.java:54)
> 	at org.apache.jackrabbit.core.query.lucene.FilterMultiColumnQueryHits.nextScoreNodes(FilterMultiColumnQueryHits.java:63)
> 	at org.apache.jackrabbit.core.query.lucene.QueryResultImpl.collectScoreNodes(QueryResultImpl.java:328)
> 	at org.apache.jackrabbit.core.query.lucene.QueryResultImpl.getResults(QueryResultImpl.java:291)
> 	at org.apache.jackrabbit.core.query.lucene.SingleColumnQueryResult.<init>(SingleColumnQueryResult.java:66)
> 	at org.apache.jackrabbit.core.query.lucene.QueryImpl.execute(QueryImpl.java:134)
> 	at org.apache.jackrabbit.core.query.QueryImpl$1.perform(QueryImpl.java:130)
> 	at org.apache.jackrabbit.core.query.QueryImpl$1.perform(QueryImpl.java:1)
> 	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:200)
> 	at org.apache.jackrabbit.core.query.QueryImpl.execute(QueryImpl.java:126)
> 	at org.apache.jackrabbit.core.security.user.IndexNodeResolver.findNodes(IndexNodeResolver.java:109)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.findAuthorizables(UserManagerImpl.java:498)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImpl.findAuthorizables(UserManagerImpl.java:462)
> 	at org.apache.jackrabbit.core.security.user.UserManagerImplTest.testFindAuthorizableByRelativePath(UserManagerImplTest.java:560)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message