Solr
  1. Solr
  2. SOLR-3454

ArrayIndexOutOfBoundsException while grouping via Solrj

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.5, 3.6, 4.0-ALPHA
    • Fix Version/s: 3.6.1, 4.0-ALPHA
    • Component/s: search
    • Labels:
      None
    • Environment:

      Windows 7, Java 6

      Description

      When we try to use the grouping function at the end of a result via solrj with the parameter group.main=true,
      an ArrayIndexOutOfBoundsException is raised.

      For instance, on a result containing 3 groups, if the start & rows parameters are equal to 2 & 5 respectively.

      I will attach a patch.

      1. SOLR-3454.diff
        4 kB
        ludovic Boutros
      2. SOLR-3454.patch
        3 kB
        Martijn van Groningen

        Activity

        Hide
        Uwe Schindler added a comment -

        Bulk close for 3.6.1

        Show
        Uwe Schindler added a comment - Bulk close for 3.6.1
        Hide
        Martijn van Groningen added a comment -

        Committed to trunk and 3.6 branch.

        Show
        Martijn van Groningen added a comment - Committed to trunk and 3.6 branch.
        Hide
        ludovic Boutros added a comment -

        Ok, thanks Martijn !

        Show
        ludovic Boutros added a comment - Ok, thanks Martijn !
        Hide
        Martijn van Groningen added a comment -

        Patch looks good! I updated patch and moved the test into the TestGroupingSearch test class. I will commit this shortly.

        Show
        Martijn van Groningen added a comment - Patch looks good! I updated patch and moved the test into the TestGroupingSearch test class. I will commit this shortly.
        Hide
        ludovic Boutros added a comment -

        I finally manage to reproduce with the start value equal to 4.

        And here is the stacktrace :

        testGroupingSimpleFormatArrayIndexOutOfBoundsException(org.apache.solr.TestGroupingJavabin) Time elapsed: 88.651 sec <<< ERROR!
        org.apache.solr.client.solrj.SolrServerException: Error executing query
        at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:95)
        at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:311)
        at org.apache.solr.TestGroupingJavabin.testGroupingSimpleFormatArrayIndexOutOfBoundsException(TestGroupingJavabin.java:74)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
        at org.apache.lucene.util.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:61)
        at org.apache.lucene.util.LuceneTestCase$SubclassSetupTeardownRule$1.evaluate(LuceneTestCase.java:630)
        at org.apache.lucene.util.LuceneTestCase$InternalSetupTeardownRule$1.evaluate(LuceneTestCase.java:536)
        at org.apache.lucene.util.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:67)
        at org.apache.lucene.util.LuceneTestCase$TestResultInterceptorRule$1.evaluate(LuceneTestCase.java:457)
        at org.apache.lucene.util.UncaughtExceptionsRule$1.evaluate(UncaughtExceptionsRule.java:74)
        at org.apache.lucene.util.LuceneTestCase$SaveThreadAndTestNameRule$1.evaluate(LuceneTestCase.java:508)
        at org.junit.rules.RunRules.evaluate(RunRules.java:18)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
        at org.apache.lucene.util.LuceneTestCaseRunner.runChild(LuceneTestCaseRunner.java:146)
        at org.apache.lucene.util.LuceneTestCaseRunner.runChild(LuceneTestCaseRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
        at org.apache.lucene.util.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:61)
        at org.apache.lucene.util.UncaughtExceptionsRule$1.evaluate(UncaughtExceptionsRule.java:74)
        at org.apache.lucene.util.StoreClassNameRule$1.evaluate(StoreClassNameRule.java:36)
        at org.apache.lucene.util.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:67)
        at org.junit.rules.RunRules.evaluate(RunRules.java:18)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
        Caused by: org.apache.solr.common.SolrException: parsing error
        at org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse(BinaryResponseParser.java:43)
        at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:469)
        at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:249)
        at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:89)
        ... 49 more
        Caused by: java.io.EOFException
        at org.apache.solr.common.util.FastInputStream.readByte(FastInputStream.java:160)
        at org.apache.solr.common.util.JavaBinCodec.readVInt(JavaBinCodec.java:657)
        at org.apache.solr.common.util.JavaBinCodec.readSize(JavaBinCodec.java:624)
        at org.apache.solr.common.util.JavaBinCodec.readExternString(JavaBinCodec.java:706)
        at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:178)
        at org.apache.solr.common.util.JavaBinCodec.readSolrDocumentList(JavaBinCodec.java:340)
        at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:207)
        at org.apache.solr.common.util.JavaBinCodec.readOrderedMap(JavaBinCodec.java:111)
        at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:174)
        at org.apache.solr.common.util.JavaBinCodec.unmarshal(JavaBinCodec.java:102)
        at org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse(BinaryResponseParser.java:41)
        ... 52 more

        A second patch is attached.

        Show
        ludovic Boutros added a comment - I finally manage to reproduce with the start value equal to 4. And here is the stacktrace : testGroupingSimpleFormatArrayIndexOutOfBoundsException(org.apache.solr.TestGroupingJavabin) Time elapsed: 88.651 sec <<< ERROR! org.apache.solr.client.solrj.SolrServerException: Error executing query at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:95) at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:311) at org.apache.solr.TestGroupingJavabin.testGroupingSimpleFormatArrayIndexOutOfBoundsException(TestGroupingJavabin.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.apache.lucene.util.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:61) at org.apache.lucene.util.LuceneTestCase$SubclassSetupTeardownRule$1.evaluate(LuceneTestCase.java:630) at org.apache.lucene.util.LuceneTestCase$InternalSetupTeardownRule$1.evaluate(LuceneTestCase.java:536) at org.apache.lucene.util.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:67) at org.apache.lucene.util.LuceneTestCase$TestResultInterceptorRule$1.evaluate(LuceneTestCase.java:457) at org.apache.lucene.util.UncaughtExceptionsRule$1.evaluate(UncaughtExceptionsRule.java:74) at org.apache.lucene.util.LuceneTestCase$SaveThreadAndTestNameRule$1.evaluate(LuceneTestCase.java:508) at org.junit.rules.RunRules.evaluate(RunRules.java:18) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.apache.lucene.util.LuceneTestCaseRunner.runChild(LuceneTestCaseRunner.java:146) at org.apache.lucene.util.LuceneTestCaseRunner.runChild(LuceneTestCaseRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.apache.lucene.util.SystemPropertiesRestoreRule$1.evaluate(SystemPropertiesRestoreRule.java:61) at org.apache.lucene.util.UncaughtExceptionsRule$1.evaluate(UncaughtExceptionsRule.java:74) at org.apache.lucene.util.StoreClassNameRule$1.evaluate(StoreClassNameRule.java:36) at org.apache.lucene.util.SystemPropertiesInvariantRule$1.evaluate(SystemPropertiesInvariantRule.java:67) at org.junit.rules.RunRules.evaluate(RunRules.java:18) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68) Caused by: org.apache.solr.common.SolrException: parsing error at org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse(BinaryResponseParser.java:43) at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:469) at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:249) at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:89) ... 49 more Caused by: java.io.EOFException at org.apache.solr.common.util.FastInputStream.readByte(FastInputStream.java:160) at org.apache.solr.common.util.JavaBinCodec.readVInt(JavaBinCodec.java:657) at org.apache.solr.common.util.JavaBinCodec.readSize(JavaBinCodec.java:624) at org.apache.solr.common.util.JavaBinCodec.readExternString(JavaBinCodec.java:706) at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:178) at org.apache.solr.common.util.JavaBinCodec.readSolrDocumentList(JavaBinCodec.java:340) at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:207) at org.apache.solr.common.util.JavaBinCodec.readOrderedMap(JavaBinCodec.java:111) at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:174) at org.apache.solr.common.util.JavaBinCodec.unmarshal(JavaBinCodec.java:102) at org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse(BinaryResponseParser.java:41) ... 52 more A second patch is attached.
        Hide
        ludovic Boutros added a comment -

        Hi Martijn,

        I'm not at my office today (vacations), so I tried to reproduce at home and you are right,
        the test not does not fail on my home computer...

        That's strange, I will try to compare the two environments to understand this behavior.

        thx,

        Ludovic.

        Show
        ludovic Boutros added a comment - Hi Martijn, I'm not at my office today (vacations), so I tried to reproduce at home and you are right, the test not does not fail on my home computer... That's strange, I will try to compare the two environments to understand this behavior. thx, Ludovic.
        Hide
        Martijn van Groningen added a comment -

        Hi Ludovic. I've tried running the attached patch on both trunk and 3.6 branch without the fix in Grouping.java, but the test doesn't fail. Is something missing in the test? Can you maybe attach a stacktrace?

        Show
        Martijn van Groningen added a comment - Hi Ludovic. I've tried running the attached patch on both trunk and 3.6 branch without the fix in Grouping.java, but the test doesn't fail. Is something missing in the test? Can you maybe attach a stacktrace?
        Hide
        ludovic Boutros added a comment -

        A test unit and a correction.

        Show
        ludovic Boutros added a comment - A test unit and a correction.

          People

          • Assignee:
            Unassigned
            Reporter:
            ludovic Boutros
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development